diff options
author | Brett Cannon <bcannon@gmail.com> | 2006-03-01 04:25:17 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2006-03-01 04:25:17 (GMT) |
commit | bf36409e2a8171b441d5e0a2f1c9e02d31a35ae8 (patch) | |
tree | 7456cf3d197d6f0dc017b0f851878bcaf6024f6c /Lib/test/test_descr.py | |
parent | 762467475d944f67ac20bf23c6c5144a6e39feae (diff) | |
download | cpython-bf36409e2a8171b441d5e0a2f1c9e02d31a35ae8.zip cpython-bf36409e2a8171b441d5e0a2f1c9e02d31a35ae8.tar.gz cpython-bf36409e2a8171b441d5e0a2f1c9e02d31a35ae8.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r-- | Lib/test/test_descr.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 2f12e96..68a11fa 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -3355,31 +3355,6 @@ def docdescriptor(): vereq(NewClass.__doc__, 'object=None; type=NewClass') vereq(NewClass().__doc__, 'object=NewClass instance; type=NewClass') -def string_exceptions(): - if verbose: - print "Testing string exceptions ..." - - # Ensure builtin strings work OK as exceptions. - astring = "An exception string." - try: - raise astring - except astring: - pass - else: - raise TestFailed, "builtin string not usable as exception" - - # Ensure string subclass instances do not. - class MyStr(str): - pass - - newstring = MyStr("oops -- shouldn't work") - try: - raise newstring - except TypeError: - pass - except: - raise TestFailed, "string subclass allowed as exception" - def copy_setstate(): if verbose: print "Testing that copy.*copy() correctly uses __setstate__..." @@ -4172,7 +4147,6 @@ def test_main(): funnynew() imulbug() docdescriptor() - string_exceptions() copy_setstate() slices() subtype_resurrection() |