Kaydet (Commit) 596db316 authored tarafından Fred Drake's avatar Fred Drake

Move the __getitem__() definition from StandardException to Exception.

This allows stuff like this out of the box:

	try:
	    ...
	except socket.error, (code, msg):
	    ...
üst bf9d353b
...@@ -58,10 +58,12 @@ class Exception: ...@@ -58,10 +58,12 @@ class Exception:
else: else:
return str(self.args) return str(self.args)
class StandardError(Exception):
def __getitem__(self, i): def __getitem__(self, i):
return self.args[i] return self.args[i]
class StandardError(Exception):
pass
class SyntaxError(StandardError): class SyntaxError(StandardError):
filename = lineno = offset = text = None filename = lineno = offset = text = None
msg = "" msg = ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment