From: Fred Drake Date: Thu, 21 Sep 2000 16:32:28 +0000 (+0000) Subject: SAXException.__getitem__(): Raise AttributeError instead of NameError. X-Git-Tag: v2.0b2~160 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=44627016da509b2bc59c38d7bf0ba592fe56a7a3;p=thirdparty%2FPython%2Fcpython.git SAXException.__getitem__(): Raise AttributeError instead of NameError. --- diff --git a/Lib/xml/sax/_exceptions.py b/Lib/xml/sax/_exceptions.py index 1553b93afb09..c02974fb8e7e 100644 --- a/Lib/xml/sax/_exceptions.py +++ b/Lib/xml/sax/_exceptions.py @@ -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 =====