Remove dict.has_key() usage in xml.sax to silence warnings under -3.

This commit is contained in:
Brett Cannon 2008-08-04 21:10:50 +00:00
parent d9636e17cc
commit 5b3d3729ba
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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)