[Python-checkins] r65462 - python/trunk/Lib/xml/dom/minidom.py
brett.cannon
python-checkins at python.org
Mon Aug 4 02:23:59 CEST 2008
Author: brett.cannon
Date: Mon Aug 4 02:23:58 2008
New Revision: 65462
Log:
Remove dict.has_key() usage in xml.dom.minidom to silence warnings while
running under -3.
Modified:
python/trunk/Lib/xml/dom/minidom.py
Modified: python/trunk/Lib/xml/dom/minidom.py
==============================================================================
--- python/trunk/Lib/xml/dom/minidom.py (original)
+++ python/trunk/Lib/xml/dom/minidom.py Mon Aug 4 02:23:58 2008
@@ -245,7 +245,7 @@
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 @@
_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 @@
_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 @@
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
More information about the Python-checkins
mailing list