Close Popen stdout

This commit is contained in:
Mikhail Gordeev 2020-04-18 03:06:44 +03:00
parent 2ddc5c5249
commit 13464ddb32

View File

@ -196,6 +196,8 @@ class CB:
with open(stdout_to_file, 'w') as f:
if p.stdout:
f.write(p.stdout.read().decode())
if p.stdout is not None:
p.stdout.close()
else:
rc = subprocess.call(cmd)
maybe_fail(string, rc)