mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-04 14:30:11 +01:00
Closes #34: Catch OSErrors when running Popen
This commit is contained in:
parent
16df9c6aec
commit
93a0d9918d
@ -1654,8 +1654,12 @@ def FDroidPopen(commands, cwd=None, shell=False, output=True):
|
|||||||
logging.debug("> %s" % ' '.join(commands))
|
logging.debug("> %s" % ' '.join(commands))
|
||||||
|
|
||||||
result = PopenResult()
|
result = PopenResult()
|
||||||
|
p = None
|
||||||
|
try:
|
||||||
p = subprocess.Popen(commands, cwd=cwd, shell=shell, env=env,
|
p = subprocess.Popen(commands, cwd=cwd, shell=shell, env=env,
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
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_queue = Queue.Queue()
|
||||||
stdout_reader = AsynchronousFileReader(p.stdout, stdout_queue)
|
stdout_reader = AsynchronousFileReader(p.stdout, stdout_queue)
|
||||||
|
Loading…
Reference in New Issue
Block a user