PEP 352 implementation. Creates a new base class, BaseException, which has an

added message attribute compared to the previous version of Exception.  It is
also a new-style class, making all exceptions now new-style.  KeyboardInterrupt
and SystemExit inherit from BaseException directly.  String exceptions now
raise DeprecationWarning.

Applies patch 1104669, and closes bugs 1012952 and 518846.
This commit is contained in:
Brett Cannon 2006-03-01 04:25:17 +00:00
parent 762467475d
commit bf36409e2a
16 changed files with 570 additions and 232 deletions

View file

@ -29,10 +29,7 @@ def test_raise_catch(exc):
def r(thing):
test_raise_catch(thing)
if isinstance(thing, ClassType):
print thing.__name__
else:
print thing
print getattr(thing, '__name__', thing)
r(AttributeError)
import sys