diff options
author | Guido van Rossum <guido@python.org> | 2000-06-29 19:35:29 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-06-29 19:35:29 (GMT) |
commit | 3e06ab1d447442a56af739a906546d8d1998dfdc (patch) | |
tree | 23145a16354b8b2e59932767c6dc9a5b56bb12cf /Lib/dos-8x3/test_exc.py | |
parent | 45cd9de2bb2faa96bb18eb11d20261d7d1b8c20e (diff) | |
download | cpython-3e06ab1d447442a56af739a906546d8d1998dfdc.zip cpython-3e06ab1d447442a56af739a906546d8d1998dfdc.tar.gz cpython-3e06ab1d447442a56af739a906546d8d1998dfdc.tar.bz2 |
The usual :)
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) |