mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 23:42:37 +03:00
Closes #34: Catch OSErrors when running Popen
This commit is contained in:
parent
16df9c6aec
commit
93a0d9918d
1 changed files with 6 additions and 2 deletions
|
@ -1654,8 +1654,12 @@ def FDroidPopen(commands, cwd=None, shell=False, output=True):
|
|||
logging.debug("> %s" % ' '.join(commands))
|
||||
|
||||
result = PopenResult()
|
||||
p = subprocess.Popen(commands, cwd=cwd, shell=shell, env=env,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
p = None
|
||||
try:
|
||||
p = subprocess.Popen(commands, cwd=cwd, shell=shell, env=env,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
except OSError, e:
|
||||
raise BuildException("OSError while trying to execute " + ' '.join(commands) + ': ' + str(e))
|
||||
|
||||
stdout_queue = Queue.Queue()
|
||||
stdout_reader = AsynchronousFileReader(p.stdout, stdout_queue)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue