Commit 315ff8cd authored by Barry Warsaw's avatar Barry Warsaw

Expanded r() function to handle class exceptions.

parent 222fcc6e
# Python test set -- part 5, built-in exceptions # Python test set -- part 5, built-in exceptions
from test_support import * from test_support import *
from types import ClassType
print '5. Built-in exceptions' print '5. Built-in exceptions'
# XXX This is not really enough, each *operation* should be tested! # 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) r(AttributeError)
import sys import sys
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment