aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-03-21 13:20:13 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-03-21 13:20:13 -0700
commit8fe96b287af747caa98bf6a55439cd16d35b546e (patch)
tree85da0f583c82677d13bdd88a737f37fb8e256721 /tools/shared.py
parenta6b2171ecf37887e67d38c560fe1dbfa1174a438 (diff)
properly handle closure compiler return codes
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 438c6c7b..8c968698 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -741,9 +741,10 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' \
'--js', filename, '--js_output_file', filename + '.cc.js']
if os.environ.get('EMCC_CLOSURE_ARGS'):
args += os.environ.get('EMCC_CLOSURE_ARGS').split(' ')
- cc_output = Popen(args, stdout=PIPE, stderr=STDOUT).communicate()[0]
- if 'ERROR' in cc_output or not os.path.exists(filename + '.cc.js'):
- raise Exception('closure compiler error: ' + cc_output)
+ process = Popen(args, stdout=PIPE, stderr=STDOUT)
+ cc_output = process.communicate()[0]
+ if process.returncode != 0 or not os.path.exists(filename + '.cc.js'):
+ raise Exception('closure compiler error: ' + cc_output + ' (rc: %d)' % process.returncode)
return filename + '.cc.js'