# HG changeset patch # User Paul Boddie # Date 1480285371 -3600 # Node ID cd7353a799382cc49f6d4d2f45e7af3c200b272b # Parent a8283e12c6b3be5e2e92a3426ed3a3f0eb530857 Removed various superfluous exception classes, also enhancing IndexError. diff -r a8283e12c6b3 -r cd7353a79938 lib/__builtins__/__init__.py --- a/lib/__builtins__/__init__.py Sun Nov 27 23:21:35 2016 +0100 +++ b/lib/__builtins__/__init__.py Sun Nov 27 23:22:51 2016 +0100 @@ -34,7 +34,6 @@ EnvironmentError, FloatingPointError, FutureWarning, - GeneratorExit, ImportError, ImportWarning, IndentationError, @@ -42,16 +41,13 @@ IOError, KeyError, KeyboardInterrupt, - LookupError, NameError, NotImplementedError, OSError, OverflowError, PendingDeprecationWarning, - ReferenceError, RuntimeError, RuntimeWarning, - StandardError, StopIteration, SyntaxError, SyntaxWarning, diff -r a8283e12c6b3 -r cd7353a79938 lib/__builtins__/exception/__init__.py --- a/lib/__builtins__/exception/__init__.py Sun Nov 27 23:21:35 2016 +0100 +++ b/lib/__builtins__/exception/__init__.py Sun Nov 27 23:22:51 2016 +0100 @@ -24,13 +24,9 @@ ) from __builtins__.exception.base import ( - GeneratorExit, IndexError, KeyError, - LookupError, NotImplementedError, - ReferenceError, - StandardError, StopIteration, ValueError ) diff -r a8283e12c6b3 -r cd7353a79938 lib/__builtins__/exception/base.py --- a/lib/__builtins__/exception/base.py Sun Nov 27 23:21:35 2016 +0100 +++ b/lib/__builtins__/exception/base.py Sun Nov 27 23:22:51 2016 +0100 @@ -19,13 +19,15 @@ this program. If not, see . """ -class GeneratorExit(Exception): pass -class IndexError(Exception): pass +class IndexError(Exception): + + "An error condition involving an index." + + def __init__(self, index): + self.index = index + class KeyError(Exception): pass -class LookupError(Exception): pass class NotImplementedError(Exception): pass -class ReferenceError(Exception): pass -class StandardError(Exception): pass class StopIteration(Exception): pass class ValueError(Exception): pass