diff options
author | Brett Cannon <bcannon@gmail.com> | 2008-08-04 21:10:50 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2008-08-04 21:10:50 (GMT) |
commit | 5b3d3729baada9e8913a2f8556bbe041834c1b17 (patch) | |
tree | c6eccbe8e2a27c10443fda7035c227385399df74 /Lib/xml | |
parent | d9636e17ccfd83bd0f7d7316aeb30d98a0a8cb07 (diff) | |
download | cpython-5b3d3729baada9e8913a2f8556bbe041834c1b17.zip cpython-5b3d3729baada9e8913a2f8556bbe041834c1b17.tar.gz cpython-5b3d3729baada9e8913a2f8556bbe041834c1b17.tar.bz2 |
Remove dict.has_key() usage in xml.sax to silence warnings under -3.
Diffstat (limited to 'Lib/xml')
-rw-r--r-- | Lib/xml/sax/__init__.py | 2 | ||||
-rw-r--r-- | Lib/xml/sax/xmlreader.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Lib/xml/sax/__init__.py b/Lib/xml/sax/__init__.py index 6b1b1ba..73ec929 100644 --- a/Lib/xml/sax/__init__.py +++ b/Lib/xml/sax/__init__.py @@ -81,7 +81,7 @@ def make_parser(parser_list = []): return _create_parser(parser_name) except ImportError,e: import sys - if sys.modules.has_key(parser_name): + if parser_name in sys.modules: # The parser module was found, but importing it # failed unexpectedly, pass this exception through raise diff --git a/Lib/xml/sax/xmlreader.py b/Lib/xml/sax/xmlreader.py index 9a2361e..8e23084 100644 --- a/Lib/xml/sax/xmlreader.py +++ b/Lib/xml/sax/xmlreader.py @@ -294,12 +294,12 @@ class AttributesImpl: return self._attrs[name] def getNameByQName(self, name): - if not self._attrs.has_key(name): + if not name in self._attrs: raise KeyError, name return name def getQNameByName(self, name): - if not self._attrs.has_key(name): + if not name in self._attrs: raise KeyError, name return name @@ -319,7 +319,7 @@ class AttributesImpl: return self._attrs.keys() def has_key(self, name): - return self._attrs.has_key(name) + return name in self._attrs def __contains__(self, name): return self._attrs.has_key(name) |