From: Fred Drake Date: Mon, 6 Oct 1997 15:48:20 +0000 (+0000) Subject: Move the __getitem__() definition from StandardException to Exception. X-Git-Tag: v1.5a4~78 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=596db3161c8cf0a492f5613cb5721b6c12c1dceb;p=python Move the __getitem__() definition from StandardException to Exception. This allows stuff like this out of the box: try: ... except socket.error, (code, msg): ... --- diff --git a/Lib/exceptions.py b/Lib/exceptions.py index 686ba38158..c7bbbf491e 100644 --- a/Lib/exceptions.py +++ b/Lib/exceptions.py @@ -58,10 +58,12 @@ class Exception: else: return str(self.args) -class StandardError(Exception): def __getitem__(self, i): return self.args[i] +class StandardError(Exception): + pass + class SyntaxError(StandardError): filename = lineno = offset = text = None msg = ""