diff options
author | Gary Oberbrunner <garyo@oberbrunner.com> | 2009-04-14 10:51:00 (GMT) |
---|---|---|
committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2009-04-14 10:51:00 (GMT) |
commit | 51cff874f72bc4afe2eb60a928472dc1669eab88 (patch) | |
tree | 76521351251ce2cd5e13b5157d2fabb24ec4b231 /src/engine/SCons/Variables/__init__.py | |
parent | a1e8d845f6d0b6f2bb86f7347fbdf1ba4a777bc4 (diff) | |
download | SCons-51cff874f72bc4afe2eb60a928472dc1669eab88.zip SCons-51cff874f72bc4afe2eb60a928472dc1669eab88.tar.gz SCons-51cff874f72bc4afe2eb60a928472dc1669eab88.tar.bz2 |
Patch submitted by Lukas Erlinghagen. Thanks, Lukas!
this patch should fix issue 2362.
- Variables that are added via Variables.Add or Variables.AddVariables
are now removed from the 'unknown' dict if present
- An option's name and its aliases can now actually be provided as a
tuple as well as a list
- Test cases for using option aliases and for issue 2362 itself are included
Diffstat (limited to 'src/engine/SCons/Variables/__init__.py')
-rw-r--r-- | src/engine/SCons/Variables/__init__.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/engine/SCons/Variables/__init__.py b/src/engine/SCons/Variables/__init__.py index 805471a..f203677 100644 --- a/src/engine/SCons/Variables/__init__.py +++ b/src/engine/SCons/Variables/__init__.py @@ -95,6 +95,12 @@ class Variables: option.converter = converter self.options.append(option) + + # options might be added after the 'unknown' dict has been set up, + # so we remove the key and all its aliases from that dict + for alias in list(option.aliases) + [ option.key ]: + if alias in self.unknown: + del self.unknown[alias] def keys(self): """ @@ -179,7 +185,7 @@ class Variables: for arg, value in args.items(): added = False for option in self.options: - if arg in option.aliases + [ option.key ]: + if arg in list(option.aliases) + [ option.key ]: values[option.key] = value added = True if not added: |