From a3cfb4a2a014e8976727cd407286a01d6f56aec2 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Thu, 10 Oct 2002 17:41:32 +0000 Subject: [PATCH] Fix verbose BuildError bug. (Anthony Roach) git-svn-id: http://scons.tigris.org/svn/scons/trunk@479 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 2 ++ src/engine/SCons/Node/__init__.py | 2 ++ test/errors.py | 15 +++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index e227920e..265b19e4 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -92,6 +92,8 @@ RELEASE 0.09 - - Add EnsurePythonVersion() and EnsureSConsVersion() functions. + - Fix the overly-verbose stack trace on ListBuilder build errors. + From sam th: - Dynamically check for the existence of utilities with which to diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 75a27c06..22bf949a 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -112,6 +112,8 @@ class Node: raise except UserError: raise + except BuildError: + raise except: raise BuildError(self, "Exception", sys.exc_type, diff --git a/test/errors.py b/test/errors.py index 979c6e11..5f780f23 100644 --- a/test/errors.py +++ b/test/errors.py @@ -27,6 +27,9 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestCmd import TestSCons import string +import sys + +python = sys.executable test = TestSCons.TestSCons(match = TestCmd.match_re_dotall) @@ -113,4 +116,16 @@ test.run(arguments='-f SConstruct3', InternalError: error inside """, status=2) +test.write('build.py', ''' +import sys +sys.exit(2) +''') + +test.write('SConstruct', """ +env=Environment() +Default(env.Command(['one.out', 'two.out'], ['foo.in'], action=r'%s build.py')) +"""%python) + +test.run(status=2, stderr="scons: \\*\\*\\* \\[one.out\\] Error 2\n") + test.pass_test() -- 2.26.2