Commit Graph

6 Commits

Author SHA1 Message Date
Fred Drake 596db3161c Move the __getitem__() definition from StandardException to Exception.
This allows stuff like this out of the box:

	try:
	    ...
	except socket.error, (code, msg):
	    ...
1997-10-06 15:48:20 +00:00
Barry Warsaw 25131faffe NumberError => ArithmeticError 1997-09-16 21:50:59 +00:00
Guido van Rossum c56ba38350 Two subtle changes:
(1) Introduce Exception as the conceptual root class for all exceptions.

(2) Do less work in __init__(), and more in __str__ (store args
unchanged).
1997-09-16 18:42:04 +00:00
Guido van Rossum e8fd143b7e #Adapt the doc string to reality. 1997-09-08 02:47:46 +00:00
Guido van Rossum f394f56c2b Made the 'info' argument to SyntaxError optional, so phase-2 syntax
errors are handled (these gave ``TypeError: not enough arguments'').

Also changed its __str__() to correct a typo (missing self.) and
return str(self.msg) to ensure the result is always string.

Also changed the default __str__ to simply return str(self.args).
1997-09-05 19:00:56 +00:00
Barry Warsaw 3e613ce79b New file, which is imported by the built-in module when python is
started with the -X option.  This file contains the definitions for
the built-in exception classes.
1997-08-29 21:59:26 +00:00