Skip to content

Commit

Permalink
Change call function to Popen
Browse files Browse the repository at this point in the history
The call function can deadlock if the child process prints larger output. Use Popen with the communicate() method with you need pipes. If you switch to Popen, you'll get cleaner debugging.
  • Loading branch information
johnjhacking authored Jun 7, 2021
1 parent 54774ab commit 62baabc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fetch-macOS.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class ReplicationError(Exception):


def cmd_exists(cmd):
return subprocess.call("type " + cmd, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0
proc subprocess.Popen("type " + cmd, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)


def replicate_url(full_url,
Expand Down

0 comments on commit 62baabc

Please sign in to comment.