commit | 44627016da509b2bc59c38d7bf0ba592fe56a7a3 | [log] [tgz] |
---|---|---|
author | Fred Drake <fdrake@acm.org> | Thu Sep 21 16:32:28 2000 +0000 |
committer | Fred Drake <fdrake@acm.org> | Thu Sep 21 16:32:28 2000 +0000 |
tree | c70c8232a2f663660a822b20f82c9412d2a5023c | |
parent | 1e3c8ccb9b65d0994dd09f8147f87d6affeaa552 [diff] |
SAXException.__getitem__(): Raise AttributeError instead of NameError.
diff --git a/Lib/xml/sax/_exceptions.py b/Lib/xml/sax/_exceptions.py index 1553b93..c02974f 100644 --- a/Lib/xml/sax/_exceptions.py +++ b/Lib/xml/sax/_exceptions.py
@@ -37,7 +37,7 @@ 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 =====