summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Taskmaster.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Taskmaster.py')
-rw-r--r--src/engine/SCons/Taskmaster.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py
index cf924e7..9bd9597 100644
--- a/src/engine/SCons/Taskmaster.py
+++ b/src/engine/SCons/Taskmaster.py
@@ -546,7 +546,13 @@ class Task(object):
if sys.version_info[0] == 2:
exec("raise exc_type, exc_value, exc_traceback")
else: # sys.version_info[0] == 3:
- exec("raise exc_value.with_traceback(exc_traceback)")
+ if isinstance(exc_value, Exception): #hasattr(exc_value, 'with_traceback'):
+ # If exc_value is an exception, then just reraise
+ exec("raise exc_value.with_traceback(exc_traceback)")
+ else:
+ # else we'll create an exception using the value and raise that
+ exec("raise exc_type(exc_value).with_traceback(exc_traceback)")
+
# raise e.__class__, e.__class__(e), sys.exc_info()[2]
# exec("raise exc_type(exc_value).with_traceback(exc_traceback)")