summaryrefslogtreecommitdiffstats
path: root/Lib/xml/dom
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/xml/dom')
-rw-r--r--Lib/xml/dom/domreg.py2
-rw-r--r--Lib/xml/dom/minidom.py8
-rw-r--r--Lib/xml/dom/xmlbuilder.py4
3 files changed, 7 insertions, 7 deletions
diff --git a/Lib/xml/dom/domreg.py b/Lib/xml/dom/domreg.py
index 684c436..ec3acdf 100644
--- a/Lib/xml/dom/domreg.py
+++ b/Lib/xml/dom/domreg.py
@@ -57,7 +57,7 @@ def getDOMImplementation(name = None, features = ()):
return mod.getDOMImplementation()
elif name:
return registered[name]()
- elif os.environ.has_key("PYTHON_DOM"):
+ elif "PYTHON_DOM" in os.environ:
return getDOMImplementation(name = os.environ["PYTHON_DOM"])
# User did not specify a name, try implementations in arbitrary
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index b8bd451..02e3b85 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -491,9 +491,9 @@ class NamedNodeMap(object):
def has_key(self, key):
if isinstance(key, StringTypes):
- return self._attrs.has_key(key)
+ return key in self._attrs
else:
- return self._attrsNS.has_key(key)
+ return key in self._attrsNS
def keys(self):
return self._attrs.keys()
@@ -775,10 +775,10 @@ class Element(Node):
removeAttributeNodeNS = removeAttributeNode
def hasAttribute(self, name):
- return self._attrs.has_key(name)
+ return name in self._attrs
def hasAttributeNS(self, namespaceURI, localName):
- return self._attrsNS.has_key((namespaceURI, localName))
+ return (namespaceURI, localName) in self._attrsNS
def getElementsByTagName(self, name):
return _get_elements_by_tagName_helper(self, name, NodeList())
diff --git a/Lib/xml/dom/xmlbuilder.py b/Lib/xml/dom/xmlbuilder.py
index ac1d448..dc7c5d4 100644
--- a/Lib/xml/dom/xmlbuilder.py
+++ b/Lib/xml/dom/xmlbuilder.py
@@ -91,7 +91,7 @@ class DOMBuilder:
def canSetFeature(self, name, state):
key = (_name_xform(name), state and 1 or 0)
- return self._settings.has_key(key)
+ return key in self._settings
# This dictionary maps from (feature,value) to a list of
# (option,value) pairs that should be set on the Options object.
@@ -247,7 +247,7 @@ class DOMEntityResolver(object):
def _guess_media_encoding(self, source):
info = source.byteStream.info()
- if info.has_key("Content-Type"):
+ if "Content-Type" in info:
for param in info.getplist():
if param.startswith("charset="):
return param.split("=", 1)[1].lower()