Skip to content

Commit

Permalink
Unpack kwargs statically
Browse files Browse the repository at this point in the history
  • Loading branch information
tothtamas28 committed Jul 3, 2024
1 parent 9810584 commit e1bc837
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pyk/src/pyk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,15 +504,15 @@ def _subprocess_run(
cwd: Path | None,
logger: Logger,
) -> CompletedProcess:
kwargs: dict[str, Any] = {
'stdin': subprocess.PIPE if input is not None else None,
'stdout': subprocess.PIPE,
'stderr': subprocess.PIPE,
'env': env,
'cwd': cwd,
}

with Popen(args, text=True, **kwargs) as popen:
with Popen(
args,
stdin=subprocess.PIPE if input is not None else None,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
env=env,
cwd=cwd,
text=True,
) as popen:
log_prefix = f'[PID={popen.pid}]'

command = shlex.join(args)
Expand Down Expand Up @@ -543,9 +543,9 @@ def _subprocess_communicate(
popen: Popen,
*,
input: str | None,
logger: Logger,
write_stdout: bool,
write_stderr: bool,
logger: Logger,
) -> tuple[int, str, str]:
assert popen.stdout is not None
assert popen.stderr is not None
Expand Down Expand Up @@ -585,7 +585,7 @@ def readerthread(
stdout_thread.join()
stderr_thread.join()

# Should be closed in readerthread at this point
# Should be closed by readerthread at this point
# popen.stdout.close()
# popen.stderr.close()

Expand Down

0 comments on commit e1bc837

Please sign in to comment.