Skip to content

Commit 955ccdb

Browse files
committed
subprocess.DEVNULL
1 parent bf7006d commit 955ccdb

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

Tools/inspection/oracle_external_inspection.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,13 @@ def target_process(code, warmup):
8686
try:
8787
proc = subprocess.Popen(
8888
[sys.executable, tmp_name],
89-
stdout=subprocess.PIPE,
90-
stderr=subprocess.PIPE,
89+
stdout=subprocess.DEVNULL,
90+
stderr=subprocess.DEVNULL,
9191
)
9292
time.sleep(warmup)
9393
if proc.poll() is not None:
94-
out, err = proc.communicate()
9594
raise RuntimeError(
96-
f"target exited unexpectedly\n"
97-
f"stdout:\n{out.decode()}\nstderr:\n{err.decode()}"
95+
f"target exited unexpectedly with code {proc.returncode}"
9896
)
9997
yield proc
10098
finally:

0 commit comments

Comments
 (0)