Expanded r() function to handle class exceptions.

This commit is contained in:
Barry Warsaw 1997-08-29 21:58:25 +00:00
parent f488af3360
commit 6ed41a0a87
1 changed files with 6 additions and 1 deletions

View 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