From 29948306bedca81fd85eb6f2978adbb454ca84db Mon Sep 17 00:00:00 2001 From: Richard Quirk Date: Sat, 24 Dec 2011 10:15:53 +0100 Subject: Fix incorrect UserError usage SCons.Errors.UserError has not been imported, so prior to this patch the code would have caused a NameError. --- src/engine/SCons/Action.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index 6909a9a..c1eef75 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -899,7 +899,7 @@ class CommandGeneratorAction(ActionBase): show=_null, execute=_null, chdir=_null, executor=None): act = self._generate(target, source, env, 0, executor) if act is None: - raise UserError("While building `%s': " + raise SCons.Errors.UserError("While building `%s': " "Cannot deduce file extension from source files: %s" % (repr(list(map(str, target))), repr(list(map(str, source))))) return act(target, source, env, exitstatfunc, presub, -- cgit v0.12 From 6788d5265cf1914081794a37b4172b794ae7375c Mon Sep 17 00:00:00 2001 From: Richard Quirk Date: Sat, 24 Dec 2011 10:21:03 +0100 Subject: Fix missing type_name declaration in error path The symbol type_name is not declared in this scope. It looks like the line that this change fixes was copied from elsewhere and not updated with the correct 'symbol' variable previously. --- src/engine/SCons/Conftest.py | 2 +- src/engine/SCons/SConfTests.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/SCons/Conftest.py b/src/engine/SCons/Conftest.py index 04a6bc2..d466278 100644 --- a/src/engine/SCons/Conftest.py +++ b/src/engine/SCons/Conftest.py @@ -554,7 +554,7 @@ def CheckDeclaration(context, symbol, includes = None, language = None): lang, suffix, msg = _lang2suffix(language) if msg: - context.Display("Cannot check for declaration %s: %s\n" % (type_name, msg)) + context.Display("Cannot check for declaration %s: %s\n" % (symbol, msg)) return msg src = includetext + includes diff --git a/src/engine/SCons/SConfTests.py b/src/engine/SCons/SConfTests.py index b05c4cc..e604886 100644 --- a/src/engine/SCons/SConfTests.py +++ b/src/engine/SCons/SConfTests.py @@ -697,6 +697,8 @@ int main() { assert r, "__cplusplus not declared in C++ ??" r = sconf.CheckDeclaration('__cplusplus', language = 'C') assert not r, "__cplusplus declared in C ??" + r = sconf.CheckDeclaration('unknown', language = 'Unknown') + assert not r, "unknown language was supported ??" finally: sconf.Finish() -- cgit v0.12