diff options
| author | Steven Knight <knight@baldmt.com> | 2002-12-19 15:31:04 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2002-12-19 15:31:04 (GMT) |
| commit | ea4fe5dcf730ea0471f4d9801206aa8f6e37453b (patch) | |
| tree | 90d25ea535f65786ea522cac59f52ffeca23b8c1 /src/engine/SCons/Taskmaster.py | |
| parent | 72d46ff0afa7d688a2029a74b0a0084dcf439ba5 (diff) | |
| download | SCons-ea4fe5dcf730ea0471f4d9801206aa8f6e37453b.zip SCons-ea4fe5dcf730ea0471f4d9801206aa8f6e37453b.tar.gz SCons-ea4fe5dcf730ea0471f4d9801206aa8f6e37453b.tar.bz2 | |
Finish the Action refactoring by removing Builder.execute() methods and moving exception handling into the Taskmaster.Task class.
Diffstat (limited to 'src/engine/SCons/Taskmaster.py')
| -rw-r--r-- | src/engine/SCons/Taskmaster.py | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py index 043ce7d..eec50bf 100644 --- a/src/engine/SCons/Taskmaster.py +++ b/src/engine/SCons/Taskmaster.py @@ -29,13 +29,12 @@ Generic Taskmaster. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - - +import copy +import string +import sys import SCons.Node -import string import SCons.Errors -import copy class Task: """Default SCons build engine task. @@ -71,12 +70,24 @@ class Task: def execute(self): """Called to execute the task. - - This methods is called from multiple threads in - a parallel build, so only do thread safe stuff here. - Do thread unsafe stuff in prepare(), executed() or failed().""" - if self.targets[0].get_state() != SCons.Node.up_to_date: + + This method is called from multiple threads in a parallel build, + so only do thread safe stuff here. Do thread unsafe stuff in + prepare(), executed() or failed().""" + try: self.targets[0].build() + except KeyboardInterrupt: + raise + except SCons.Errors.UserError: + raise + except SCons.Errors.BuildError: + raise + except: + raise SCons.Errors.BuildError(self.targets[0], + "Exception", + sys.exc_type, + sys.exc_value, + sys.exc_traceback) def get_target(self): """Fetch the target being built or updated by this task. |
