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/__init__.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/__init__.py')
| -rw-r--r-- | src/engine/SCons/Script/__init__.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 2dbb961..87e9602 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -153,18 +153,12 @@ class BuildTask(SCons.Taskmaster.Task): # is to display the various types of Errors and Exceptions # appropriately. status = 2 - e = sys.exc_value - t = sys.exc_type + t, e = self.exc_info()[:2] tb = None - if t is SCons.Errors.TaskmasterException: - # The Taskmaster received an Error or Exception while trying - # to process or build the Nodes and dependencies, which it - # wrapped up for us in the object recorded as the value of - # the Exception, so process the wrapped info instead of the - # TaskmasterException itself. - t = e.type - tb = e.traceback - e = e.value + if t is None: + # The Taskmaster didn't record an exception for this Task; + # see if the sys module has one. + t, e = sys.exc_info()[:2] if t == SCons.Errors.BuildError: sys.stderr.write("scons: *** [%s] %s\n" % (e.node, e.errstr)) @@ -187,6 +181,8 @@ class BuildTask(SCons.Taskmaster.Task): self.do_failed(status) + self.exc_clear() + def make_ready(self): """Make a task ready for execution""" SCons.Taskmaster.Task.make_ready(self) |
