mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-11 15:13:27 +02: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 = subprocess.Popen(commands, cwd=cwd, shell=shell, env=env,
|
p = None
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
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_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