diff options
author | Mathew Robinson <chasinglogic@gmail.com> | 2020-01-06 19:14:22 (GMT) |
---|---|---|
committer | Mathew Robinson <chasinglogic@gmail.com> | 2020-01-06 19:14:22 (GMT) |
commit | 0aaa5d29927629baa7025b26735e5169b6fba955 (patch) | |
tree | def2863baa863f968dc92de94026fd9491607fc3 /src/engine/SCons | |
parent | d88e0e7b976c2f9e261f03189441ab6af4c37de3 (diff) | |
download | SCons-0aaa5d29927629baa7025b26735e5169b6fba955.zip SCons-0aaa5d29927629baa7025b26735e5169b6fba955.tar.gz SCons-0aaa5d29927629baa7025b26735e5169b6fba955.tar.bz2 |
Store unexpanded string for reporting in error messages
Diffstat (limited to 'src/engine/SCons')
-rw-r--r-- | src/engine/SCons/Subst.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/engine/SCons/Subst.py b/src/engine/SCons/Subst.py index 2e469ce..59b0fcb 100644 --- a/src/engine/SCons/Subst.py +++ b/src/engine/SCons/Subst.py @@ -376,6 +376,9 @@ class StringSubber(object): if key[0] == '{': key = key[1:-1] + # Store for error messages if we fail to expand the + # value + old_s = s s = None if key in lvars: s = lvars[key] @@ -389,10 +392,10 @@ class StringSubber(object): except Exception as e: if e.__class__ in AllowableExceptions: return '' - raise_exception(e, lvars['TARGETS'], s) + raise_exception(e, lvars['TARGETS'], old_s) if s is None and NameError not in AllowableExceptions: - raise_exception(NameError(key), lvars['TARGETS'], s) + raise_exception(NameError(key), lvars['TARGETS'], old_s) elif s is None: return '' @@ -528,6 +531,9 @@ class ListSubber(collections.UserList): if key[0] == '{': key = key[1:-1] + # Store for error messages if we fail to expand the + # value + old_s = s s = None if key in lvars: s = lvars[key] @@ -541,10 +547,10 @@ class ListSubber(collections.UserList): except Exception as e: if e.__class__ in AllowableExceptions: return - raise_exception(e, lvars['TARGETS'], s) + raise_exception(e, lvars['TARGETS'], old_s) if s is None and NameError not in AllowableExceptions: - raise_exception(NameError(), lvars['TARGETS'], s) + raise_exception(NameError(), lvars['TARGETS'], old_s) elif s is None: return |