mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
SAXException.__getitem__(): Raise AttributeError instead of NameError.
This commit is contained in:
parent
1e3c8ccb9b
commit
44627016da
1 changed files with 1 additions and 1 deletions
|
|
@ -37,7 +37,7 @@ def __str__(self):
|
||||||
def __getitem__(self, ix):
|
def __getitem__(self, ix):
|
||||||
"""Avoids weird error messages if someone does exception[ix] by
|
"""Avoids weird error messages if someone does exception[ix] by
|
||||||
mistake, since Exception has __getitem__ defined."""
|
mistake, since Exception has __getitem__ defined."""
|
||||||
raise NameError("__getitem__")
|
raise AttributeError("__getitem__")
|
||||||
|
|
||||||
|
|
||||||
# ===== SAXPARSEEXCEPTION =====
|
# ===== SAXPARSEEXCEPTION =====
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue