mirror of https://github.com/python/cpython
Move the __getitem__() definition from StandardException to Exception.
This allows stuff like this out of the box: try: ... except socket.error, (code, msg): ...
This commit is contained in:
parent
bf9d353bab
commit
596db3161c
|
@ -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 = ""
|
||||
|
|
Loading…
Reference in New Issue