# HG changeset patch # User Paul Boddie # Date 1481375041 -3600 # Node ID 719d231198184b32d72c8904341395b97690a711 # Parent 32942668c75caeace7969d1246450aa35160a36c Removed superfluous exceptions; added an attribute to AttributeError instances. diff -r 32942668c75c -r 719d23119818 lib/__builtins__/__init__.py --- a/lib/__builtins__/__init__.py Sat Dec 10 14:02:44 2016 +0100 +++ b/lib/__builtins__/__init__.py Sat Dec 10 14:04:01 2016 +0100 @@ -35,14 +35,11 @@ EnvironmentError, FloatingPointError, FutureWarning, - ImportError, - ImportWarning, IndentationError, IndexError, IOError, KeyError, KeyboardInterrupt, - NameError, NotImplementedError, OSError, PendingDeprecationWarning, @@ -54,7 +51,6 @@ SystemError, SystemExit, TabError, - UnboundLocalError, UnicodeDecodeError, UnicodeEncodeError, UnicodeError, diff -r 32942668c75c -r 719d23119818 lib/__builtins__/exception/__init__.py --- a/lib/__builtins__/exception/__init__.py Sat Dec 10 14:02:44 2016 +0100 +++ b/lib/__builtins__/exception/__init__.py Sat Dec 10 14:04:01 2016 +0100 @@ -38,11 +38,7 @@ ) from __builtins__.exception.naming import ( - AttributeError, - ImportError, - ImportWarning, - NameError, - UnboundLocalError + AttributeError ) from __builtins__.exception.numeric import ( diff -r 32942668c75c -r 719d23119818 lib/__builtins__/exception/naming.py --- a/lib/__builtins__/exception/naming.py Sat Dec 10 14:02:44 2016 +0100 +++ b/lib/__builtins__/exception/naming.py Sat Dec 10 14:04:01 2016 +0100 @@ -3,7 +3,10 @@ """ Name-related exception objects. -Copyright (C) 2015 Paul Boddie +Errors regarding unrecognised names or import failures are not provided since +these errors should occur during program compilation. + +Copyright (C) 2015, 2016 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -19,10 +22,14 @@ this program. If not, see . """ -class AttributeError(Exception): pass -class ImportError(Exception): pass -class ImportWarning(Warning): pass -class NameError(Exception): pass -class UnboundLocalError(Exception): pass +class AttributeError(Exception): + + "An error indicating an invalid attribute for an object." + + def __init__(self, name): + + "Initialise the exception with the given 'name'." + + self.name = name # vim: tabstop=4 expandtab shiftwidth=4