diff options
author | Steven Knight <knight@baldmt.com> | 2004-07-13 06:13:18 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-07-13 06:13:18 (GMT) |
commit | 9d2af963f5da83955b06353104b44ad01c86716c (patch) | |
tree | 62dbd0e4ee82caf4bf3202b8aa8e53be76a9f49a /src/engine/SCons/Script/SConscript.py | |
parent | 321ac083cf44290c309b7021594c3941bfa3f82f (diff) | |
download | SCons-9d2af963f5da83955b06353104b44ad01c86716c.zip SCons-9d2af963f5da83955b06353104b44ad01c86716c.tar.gz SCons-9d2af963f5da83955b06353104b44ad01c86716c.tar.bz2 |
Make exception handling thread-safe by using sys.exc_info() instead of sys.exc_{type,value}.
Diffstat (limited to 'src/engine/SCons/Script/SConscript.py')
-rw-r--r-- | src/engine/SCons/Script/SConscript.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index 81450e9..074477f 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -270,7 +270,8 @@ def SConscript_exception(file=sys.stderr): This will show users who have Python errors where the problem is, without cluttering the output with all of the internal calls leading up to where we exec the SConscript.""" - stack = traceback.extract_tb(sys.exc_traceback) + exc_type, exc_value, exc_tb = sys.exc_info() + stack = traceback.extract_tb(exc_tb) last_text = "" found = 0 i = 0 @@ -284,10 +285,10 @@ def SConscript_exception(file=sys.stderr): # We did not find our exec statement, so this was actually a bug # in SCons itself. Show the whole stack. i = 0 - type = str(sys.exc_type) + type = str(exc_type) if type[:11] == "exceptions.": type = type[11:] - file.write('%s: %s:\n' % (type, sys.exc_value)) + file.write('%s: %s:\n' % (type, exc_value)) for fname, line, func, text in stack[i:]: file.write(' File "%s", line %d:\n' % (fname, line)) file.write(' %s\n' % text) |