]> granicus.if.org Git - python/commitdiff
SAXException.__getitem__(): Raise AttributeError instead of NameError.
authorFred Drake <fdrake@acm.org>
Thu, 21 Sep 2000 16:32:28 +0000 (16:32 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 21 Sep 2000 16:32:28 +0000 (16:32 +0000)
Lib/xml/sax/_exceptions.py

index 1553b93afb095913d91764ded85e753bd8b23a74..c02974fb8e7e4eb2c9f364450f5002c02fc229b6 100644 (file)
@@ -37,7 +37,7 @@ class SAXException(Exception):
     def __getitem__(self, ix):
         """Avoids weird error messages if someone does exception[ix] by
         mistake, since Exception has __getitem__ defined."""
-        raise NameError("__getitem__")
+        raise AttributeError("__getitem__")
 
 
 # ===== SAXPARSEEXCEPTION =====