1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-08-16 11:20:10 +02:00

Closes #34: Catch OSErrors when running Popen

This commit is contained in:
Daniel Martí 2014-09-11 23:08:51 +02:00
parent 16df9c6aec
commit 93a0d9918d

View File

@ -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)