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 | a2164ae582044afd661aaac55765db614dde9b4d (patch) | |
tree | 47efff348cf3446332113e96adac321c7e4478f7 /src/engine | |
parent | 0a34420780fe0f7fb3f7a8d9f13eccb8ac1f2738 (diff) | |
download | SCons-a2164ae582044afd661aaac55765db614dde9b4d.zip SCons-a2164ae582044afd661aaac55765db614dde9b4d.tar.gz SCons-a2164ae582044afd661aaac55765db614dde9b4d.tar.bz2 |
Print stacktrace for UserErrors when --debug=stacktrace is used. (Chad Austin)
Diffstat (limited to 'src/engine')
-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)) |