From ed7711b7cb00cd2dfab52e9626f67632a3d75816 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 24 Dec 1991 13:24:53 +0000 Subject: [PATCH] Sorted exceptions; added ImportError. --- Python/bltinmodule.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 1a9bfc68e1d..dd07e28f429 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -605,6 +605,7 @@ getbuiltin(name) object *AttributeError; object *EOFError; object *IOError; +object *ImportError; object *IndexError; object *KeyError; object *KeyboardInterrupt; @@ -631,21 +632,22 @@ newstdexception(name) static void initerrors() { - RuntimeError = newstdexception("RuntimeError"); + AttributeError = newstdexception("AttributeError"); EOFError = newstdexception("EOFError"); - TypeError = newstdexception("TypeError"); + IOError = newstdexception("IOError"); + ImportError = newstdexception("ImportError"); + IndexError = newstdexception("IndexError"); + KeyError = newstdexception("KeyError"); + KeyboardInterrupt = newstdexception("KeyboardInterrupt"); MemoryError = newstdexception("MemoryError"); NameError = newstdexception("NameError"); - SystemError = newstdexception("SystemError"); - KeyboardInterrupt = newstdexception("KeyboardInterrupt"); - AttributeError = newstdexception("AttributeError"); - IOError = newstdexception("IOError"); - ZeroDivisionError = newstdexception("ZeroDivisionError"); - IndexError = newstdexception("IndexError"); - ValueError = newstdexception("ValueError"); - KeyError = newstdexception("KeyError"); OverflowError = newstdexception("OverflowError"); + RuntimeError = newstdexception("RuntimeError"); SyntaxError = newstdexception("SyntaxError"); + SystemError = newstdexception("SystemError"); + TypeError = newstdexception("TypeError"); + ValueError = newstdexception("ValueError"); + ZeroDivisionError = newstdexception("ZeroDivisionError"); } void