refactoring

This commit is contained in:
Devaev Maxim
2020-06-04 06:27:52 +03:00
parent be9ce4e4ff
commit 9cee98310d
5 changed files with 17 additions and 14 deletions

View File

@@ -45,7 +45,7 @@ async def _run_process(cmd: str, input: Optional[str]=None) -> None: # pylint:
proc = await asyncio.create_subprocess_exec(
*cmd.split(" "),
stdin=(asyncio.subprocess.PIPE if input is not None else None),
preexec_fn=aioproc.preexec_ignore_sigint,
preexec_fn=aioproc.ignore_sigint,
)
await proc.communicate(input.encode() if input is not None else None)
assert proc.returncode == 0