summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1997-08-29 21:58:25 (GMT)
committerBarry Warsaw <barry@python.org>1997-08-29 21:58:25 (GMT)
commit6ed41a0a873ba46247197809b396c6532617251e (patch)
treebbb3f8b5e56fa1c0cbbfba0ba9b1831acbeb32fe /Lib/test/test_exceptions.py
parentf488af33605952e2e43bf55087a6400629e43790 (diff)
downloadcpython-6ed41a0a873ba46247197809b396c6532617251e.zip
cpython-6ed41a0a873ba46247197809b396c6532617251e.tar.gz
cpython-6ed41a0a873ba46247197809b396c6532617251e.tar.bz2
Expanded r() function to handle class exceptions.
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r--Lib/test/test_exceptions.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 4fbee3e..dbcdbe8 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -1,11 +1,16 @@
# Python test set -- part 5, built-in exceptions
from test_support import *
+from types import ClassType
print '5. Built-in exceptions'
# XXX This is not really enough, each *operation* should be tested!
-def r(name): print name
+def r(thing):
+ if type(thing) == ClassType:
+ print thing.__name__
+ else:
+ print thing
r(AttributeError)
import sys