Remove dict.has_key() usage in xml.sax to silence warnings under -3.
This commit is contained in:
parent
d9636e17cc
commit
5b3d3729ba
|
@ -81,7 +81,7 @@ def make_parser(parser_list = []):
|
||||||
return _create_parser(parser_name)
|
return _create_parser(parser_name)
|
||||||
except ImportError,e:
|
except ImportError,e:
|
||||||
import sys
|
import sys
|
||||||
if sys.modules.has_key(parser_name):
|
if parser_name in sys.modules:
|
||||||
# The parser module was found, but importing it
|
# The parser module was found, but importing it
|
||||||
# failed unexpectedly, pass this exception through
|
# failed unexpectedly, pass this exception through
|
||||||
raise
|
raise
|
||||||
|
|
|
@ -294,12 +294,12 @@ class AttributesImpl:
|
||||||
return self._attrs[name]
|
return self._attrs[name]
|
||||||
|
|
||||||
def getNameByQName(self, name):
|
def getNameByQName(self, name):
|
||||||
if not self._attrs.has_key(name):
|
if not name in self._attrs:
|
||||||
raise KeyError, name
|
raise KeyError, name
|
||||||
return name
|
return name
|
||||||
|
|
||||||
def getQNameByName(self, name):
|
def getQNameByName(self, name):
|
||||||
if not self._attrs.has_key(name):
|
if not name in self._attrs:
|
||||||
raise KeyError, name
|
raise KeyError, name
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ class AttributesImpl:
|
||||||
return self._attrs.keys()
|
return self._attrs.keys()
|
||||||
|
|
||||||
def has_key(self, name):
|
def has_key(self, name):
|
||||||
return self._attrs.has_key(name)
|
return name in self._attrs
|
||||||
|
|
||||||
def __contains__(self, name):
|
def __contains__(self, name):
|
||||||
return self._attrs.has_key(name)
|
return self._attrs.has_key(name)
|
||||||
|
|
Loading…
Reference in New Issue