Skip to content

Commit 95276b8

Browse files
committed
Using subprocess.Popen over subprocess.call
Signed-off-by: Andrew V. Jones <[email protected]>
1 parent 008cceb commit 95276b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cnippet/Process.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ def execute(parent, cmd, *args, **kwargs):
2424

2525
with xtrace(parent, flatten(cmd)) as h:
2626
try:
27-
code = subprocess.call(cmd, *args, **kwargs)
27+
with subprocess.Popen(cmd, *args, **kwargs) as process:
28+
_, _ = process.communicate()
29+
code = process.returncode
2830
except:
2931
sys.exit(
3032
DiagnosticReporter.fatal(EXCEPTION_EXECUTING_PROCESS, cmd[0]))

0 commit comments

Comments
 (0)