Skip to content

Commit

Permalink
fix: finally block should wait until subprocess terminate
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Apr 1, 2024
1 parent a6cfb16 commit 4bf22c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pylib/gyp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ def GetCrossCompilerPredefines(): # -> dict
shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT
)
stdout = out.communicate()[0]
finally:
os.unlink(input)
else:
Expand All @@ -459,9 +460,9 @@ def GetCrossCompilerPredefines(): # -> dict
shell=False,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT
)
stdout = out.communicate()[0]

lines = out.communicate()[0].decode("utf-8").replace(
"\r\n", "\n").split("\n")
lines = stdout.decode("utf-8").replace("\r\n", "\n").split("\n")
for line in lines:
if not line:
continue
Expand Down

0 comments on commit 4bf22c4

Please sign in to comment.