aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2012-09-22 13:00:57 +0300
committerJukka Jylänki <jujjyl@gmail.com>2012-11-12 21:14:38 +0200
commitb8b117d4341a66317fc956dc0779229ef6882dd5 (patch)
tree6123489eb3be5e9996adcc2a6ba28168acb82400
parent4f25d496a133c0dd8146b76a7550e0a45d11795b (diff)
Don't silently suppress received exceptions inside shared.building.is_ar and shared.building.is_bitcode functions, but print information about them before returning False. On Windows, depending on the version of make, these calls have been observed to fail with a "WindowsError: [Error 6] The handle is invalid", so be loud about it when this occurs. For more information, see http://bugs.python.org/issue3905 .
-rw-r--r--tools/shared.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/shared.py b/tools/shared.py
index b8242db3..12728114 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -988,7 +988,8 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e
b[6] == '>' and ord(b[7]) == 10
Building._is_ar_cache[filename] = sigcheck
return sigcheck
- except:
+ except Exception, e:
+ print 'shared.Building.is_ar failed to test whether file \'%s\' is a llvm archive file! Failed on exception: %s' % (filename, e)
return False
@staticmethod
@@ -1006,7 +1007,8 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e
test_ll = os.path.join(EMSCRIPTEN_TEMP_DIR, 'test.ll')
Building.llvm_dis(filename, test_ll)
assert os.path.exists(test_ll)
- except:
+ except Exception, e:
+ print 'shared.Building.is_bitcode failed to test whether file \'%s\' is a llvm bitcode file! Failed on exception: %s' % (filename, e)
return False
# look for magic signature