Skip to content
Snippets Groups Projects
Commit 16468fb1 authored by chrg's avatar chrg
Browse files

Wait for response

parent 522f86be
No related branches found
No related tags found
No related merge requests found
......@@ -176,18 +176,21 @@ def mktransformer(program, args, batch):
formatproc = utils.popen(
[program] + pargs,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
universal_newlines=False,
)
if formatproc.stdin is None:
if formatproc.stdin is None or formatproc.stdout is None:
raise RuntimeError("Could not start the formatting program")
fin = formatproc.stdin
fin, fout = formatproc.stdin, formatproc.stdout
def transformer(file: Path, content: bytes) -> bytes:
with utils.tfile(folder, file.name, content) as tmp_file:
try:
with utils.timeit(file.name):
fin.write(str(tmp_file).encode("utf-8") + b"\n") # type: ignore
fin.flush()
log.debug("Process respond %s:", fout.readline().encode())
except subprocess.CalledProcessError:
file = Path(file.name).with_suffix("input").absolute()
log.error("Writing argument to %s", file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment