Provide a better exception when spidermonkey exits abormally
This commit is contained in:
Родитель
b3b29b8836
Коммит
3b831df214
|
@ -112,12 +112,14 @@ def _get_tree(name, code):
|
||||||
temp.write(data)
|
temp.write(data)
|
||||||
temp.flush() # This is very important
|
temp.flush() # This is very important
|
||||||
|
|
||||||
shell = subprocess.Popen([SPIDERMONKEY, "-f", temp.name],
|
cmd = [SPIDERMONKEY, "-f", temp.name]
|
||||||
|
shell = subprocess.Popen(cmd,
|
||||||
shell=False,
|
shell=False,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
results = shell.communicate()
|
data, stderr = shell.communicate()
|
||||||
data = results[0]
|
if stderr:
|
||||||
|
raise RuntimeError('Error calling %r: %s', (cmd, stderr))
|
||||||
|
|
||||||
# Closing the temp file will delete it.
|
# Closing the temp file will delete it.
|
||||||
temp.close()
|
temp.close()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче