diff options
author | Mats Wichmann <mats@linux.com> | 2021-03-10 17:14:16 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2021-03-11 21:03:07 (GMT) |
commit | ab0507d7d7baccef0960cd1d60d837e39f3161e3 (patch) | |
tree | da8e9634f22ef162febc2c2f2283c449be3cb551 /SCons/Script | |
parent | d10c8b15aa2ca3b6024fa6d9c99656d11205e266 (diff) | |
download | SCons-ab0507d7d7baccef0960cd1d60d837e39f3161e3.zip SCons-ab0507d7d7baccef0960cd1d60d837e39f3161e3.tar.gz SCons-ab0507d7d7baccef0960cd1d60d837e39f3161e3.tar.bz2 |
Drop dictionary has_key references: Py2-ism.
In some cases, added a __contains__ method instead,
not because it necessarily was needed, but for completeness.
Also one completely unrelated change because it happened to
be sitting modified in the tree when I committed modified files:
be a little more cautious about building CHECK_METHODS in
our subclassing of the optparse Option class... current
cpython starts it at None, then fills it in, so it shouldn't
be None when we subclass.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons/Script')
-rw-r--r-- | SCons/Script/SConsOptions.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/SCons/Script/SConsOptions.py b/SCons/Script/SConsOptions.py index 8d45cf5..02e3b2c 100644 --- a/SCons/Script/SConsOptions.py +++ b/SCons/Script/SConsOptions.py @@ -227,7 +227,10 @@ class SConsOption(optparse.Option): fmt = "option %s: nargs='?' is incompatible with short options" raise SCons.Errors.UserError(fmt % self._short_opts[0]) - CHECK_METHODS = optparse.Option.CHECK_METHODS + [_check_nargs_optional] + CHECK_METHODS = optparse.Option.CHECK_METHODS + if CHECK_METHODS is None: + CHECK_METHODS = [] + CHECK_METHODS += [_check_nargs_optional] CONST_ACTIONS = optparse.Option.CONST_ACTIONS + optparse.Option.TYPED_ACTIONS class SConsOptionGroup(optparse.OptionGroup): |