mirror of https://github.com/python/cpython
Remove dict.has_key() usage in xml.dom.minidom to silence warnings while
running under -3.
This commit is contained in:
parent
a36f8fefb0
commit
5dd504df28
|
@ -245,7 +245,7 @@ class Node(xml.dom.Node):
|
|||
except AttributeError:
|
||||
d = {}
|
||||
self._user_data = d
|
||||
if d.has_key(key):
|
||||
if key in d:
|
||||
old = d[key][0]
|
||||
if data is None:
|
||||
# ignore handlers passed for None
|
||||
|
@ -562,7 +562,7 @@ class NamedNodeMap(object):
|
|||
_clear_id_cache(self._ownerElement)
|
||||
del self._attrs[n.nodeName]
|
||||
del self._attrsNS[(n.namespaceURI, n.localName)]
|
||||
if n.__dict__.has_key('ownerElement'):
|
||||
if 'ownerElement' in n.__dict__:
|
||||
n.__dict__['ownerElement'] = None
|
||||
return n
|
||||
else:
|
||||
|
@ -574,7 +574,7 @@ class NamedNodeMap(object):
|
|||
_clear_id_cache(self._ownerElement)
|
||||
del self._attrsNS[(n.namespaceURI, n.localName)]
|
||||
del self._attrs[n.nodeName]
|
||||
if n.__dict__.has_key('ownerElement'):
|
||||
if 'ownerElement' in n.__dict__:
|
||||
n.__dict__['ownerElement'] = None
|
||||
return n
|
||||
else:
|
||||
|
@ -1664,7 +1664,7 @@ class Document(Node, DocumentLS):
|
|||
return n
|
||||
|
||||
def getElementById(self, id):
|
||||
if self._id_cache.has_key(id):
|
||||
if id in self._id_cache:
|
||||
return self._id_cache[id]
|
||||
if not (self._elem_info or self._magic_id_count):
|
||||
return None
|
||||
|
|
Loading…
Reference in New Issue