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/Scanner | |
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/Scanner')
-rw-r--r-- | SCons/Scanner/FortranTests.py | 2 | ||||
-rw-r--r-- | SCons/Scanner/IDLTests.py | 2 | ||||
-rw-r--r-- | SCons/Scanner/ProgTests.py | 2 | ||||
-rw-r--r-- | SCons/Scanner/RCTests.py | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/SCons/Scanner/FortranTests.py b/SCons/Scanner/FortranTests.py index 487fb7b..729e91a 100644 --- a/SCons/Scanner/FortranTests.py +++ b/SCons/Scanner/FortranTests.py @@ -214,7 +214,7 @@ class DummyEnvironment: else: raise KeyError("Dummy environment only has FORTRANPATH attribute.") - def has_key(self, key): + def __contains__(self, key): return key in self.Dictionary() def __getitem__(self, key): diff --git a/SCons/Scanner/IDLTests.py b/SCons/Scanner/IDLTests.py index fc1d1c8..28433d1 100644 --- a/SCons/Scanner/IDLTests.py +++ b/SCons/Scanner/IDLTests.py @@ -207,7 +207,7 @@ class DummyEnvironment: path = [path] return list(map(self.subst, path)) - def has_key(self, key): + def __contains__(self, key): return key in self.Dictionary() def __getitem__(self,key): diff --git a/SCons/Scanner/ProgTests.py b/SCons/Scanner/ProgTests.py index 4b17d9b..5aa0571 100644 --- a/SCons/Scanner/ProgTests.py +++ b/SCons/Scanner/ProgTests.py @@ -57,7 +57,7 @@ class DummyEnvironment: else: return [self._dict[x] for x in args] - def has_key(self, key): + def __contains__(self, key): return key in self.Dictionary() def __getitem__(self,key): diff --git a/SCons/Scanner/RCTests.py b/SCons/Scanner/RCTests.py index 9183ec7..8835e5f 100644 --- a/SCons/Scanner/RCTests.py +++ b/SCons/Scanner/RCTests.py @@ -89,8 +89,8 @@ class DummyEnvironment(collections.UserDict): path = [path] return list(map(self.subst, path)) - def has_key(self, key): - return key in self.Dictionary() + def __contains__(self, key): + return key in self.data def get_calculator(self): return None |