]> granicus.if.org Git - python/commitdiff
Expanded r() function to handle class exceptions.
authorBarry Warsaw <barry@python.org>
Fri, 29 Aug 1997 21:58:25 +0000 (21:58 +0000)
committerBarry Warsaw <barry@python.org>
Fri, 29 Aug 1997 21:58:25 +0000 (21:58 +0000)
Lib/test/test_exceptions.py

index 4fbee3e76a1d3a5b6abff176e2d6f75c5fbca3b3..dbcdbe809706d42d4cacdcfeea482b7acfd14715 100644 (file)
@@ -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