summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-12-13 20:48:29 (GMT)
committerFred Drake <fdrake@acm.org>2000-12-13 20:48:29 (GMT)
commitec126dab9c98be553e17847e1599a1fbcdea9538 (patch)
tree256011152488555a8ca37e87e6bb3291f43dd751
parentdd802208a739b96b7dea0d9533e34f6410b843ce (diff)
downloadcpython-ec126dab9c98be553e17847e1599a1fbcdea9538.zip
cpython-ec126dab9c98be553e17847e1599a1fbcdea9538.tar.gz
cpython-ec126dab9c98be553e17847e1599a1fbcdea9538.tar.bz2
When raising KeyError, provide the key value that failed.
-rw-r--r--Lib/xml/sax/xmlreader.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/xml/sax/xmlreader.py b/Lib/xml/sax/xmlreader.py
index b336cb2..58ee814 100644
--- a/Lib/xml/sax/xmlreader.py
+++ b/Lib/xml/sax/xmlreader.py
@@ -292,12 +292,12 @@ class AttributesImpl:
def getNameByQName(self, name):
if not self._attrs.has_key(name):
- raise KeyError
+ raise KeyError, name
return name
def getQNameByName(self, name):
if not self._attrs.has_key(name):
- raise KeyError
+ raise KeyError, name
return name
def getNames(self):
@@ -347,14 +347,14 @@ class AttributesNSImpl(AttributesImpl):
if qname == name:
return self._attrs[nsname]
- raise KeyError
+ raise KeyError, name
def getNameByQName(self, name):
for (nsname, qname) in self._qnames.items():
if qname == name:
return nsname
- raise KeyError
+ raise KeyError, name
def getQNameByName(self, name):
return self._qnames[name]