diff options
Diffstat (limited to 'Lib/dos-8x3/test_exc.py')
-rwxr-xr-x | Lib/dos-8x3/test_exc.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/dos-8x3/test_exc.py b/Lib/dos-8x3/test_exc.py index 9796ef4..7bc515c 100755 --- a/Lib/dos-8x3/test_exc.py +++ b/Lib/dos-8x3/test_exc.py @@ -6,7 +6,19 @@ from types import ClassType print '5. Built-in exceptions' # XXX This is not really enough, each *operation* should be tested! +def test_raise_catch(exc): + try: + raise exc, "spam" + except exc, err: + buf = str(err) + try: + raise exc("spam") + except exc, err: + buf = str(err) + print buf + def r(thing): + test_raise_catch(thing) if type(thing) == ClassType: print thing.__name__ else: @@ -94,4 +106,8 @@ r(ZeroDivisionError) try: x = 1/0 except ZeroDivisionError: pass +r(Exception) +try: x = 1/0 +except Exception, e: pass + unlink(TESTFN) |