summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/xml/sax/__init__.py2
-rw-r--r--Lib/xml/sax/xmlreader.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/Lib/xml/sax/__init__.py b/Lib/xml/sax/__init__.py
index 6b1b1ba..73ec929 100644
--- a/Lib/xml/sax/__init__.py
+++ b/Lib/xml/sax/__init__.py
@@ -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
diff --git a/Lib/xml/sax/xmlreader.py b/Lib/xml/sax/xmlreader.py
index 9a2361e..8e23084 100644
--- a/Lib/xml/sax/xmlreader.py
+++ b/Lib/xml/sax/xmlreader.py
@@ -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)