diff options
author | Steven Knight <knight@baldmt.com> | 2005-08-11 02:40:21 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-08-11 02:40:21 (GMT) |
commit | 4f9b67c3139189bd317599560017695b3781d67c (patch) | |
tree | 47efff348cf3446332113e96adac321c7e4478f7 /src | |
parent | 8edcfef5f563ebf1ca3922b97ca4cbae927af279 (diff) | |
download | SCons-4f9b67c3139189bd317599560017695b3781d67c.zip SCons-4f9b67c3139189bd317599560017695b3781d67c.tar.gz SCons-4f9b67c3139189bd317599560017695b3781d67c.tar.bz2 |
Print stacktrace for UserErrors when --debug=stacktrace is used. (Chad Austin)
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Script/Main.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index b53edb2..c41587c 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -377,7 +377,10 @@ def _scons_user_error(e): The file and line number will be the deepest stack frame that is not part of SCons itself. """ + global print_stacktrace etype, value, tb = sys.exc_info() + if print_stacktrace: + traceback.print_exception(etype, value, tb) filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_tb(tb)) sys.stderr.write("\nscons: *** %s\n" % value) sys.stderr.write('File "%s", line %d, in %s\n' % (filename, lineno, routine)) |