diff options
author | Barry Warsaw <barry@python.org> | 1997-08-29 21:58:25 +0000 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1997-08-29 21:58:25 +0000 |
commit | 315ff8cd85ad682cac5516b34f8413636fc2819d (patch) | |
tree | 3b6dc61faeb855f0de75f95f2abefa520bd2bd7b /Lib/test/test_exceptions.py | |
parent | 222fcc6e9f6d196eb85e6a5fd8de163ff717bcb3 (diff) | |
download | cpython-315ff8cd85ad682cac5516b34f8413636fc2819d.tar.gz |
Expanded r() function to handle class exceptions.
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r-- | Lib/test/test_exceptions.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 4fbee3e76a..dbcdbe8097 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 |