From: Barry Warsaw Date: Fri, 29 Aug 1997 21:58:25 +0000 (+0000) Subject: Expanded r() function to handle class exceptions. X-Git-Tag: v1.5a4~278 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ed41a0a873ba46247197809b396c6532617251e;p=python Expanded r() function to handle class exceptions. --- 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