2016-12-05 | Paul Boddie | raw files shortlog changelog graph | Added tests of instance and class exception raising. | |
tests/exceptions.py (file) |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/exceptions.py Mon Dec 05 17:22:03 2016 +0100 1.3 @@ -0,0 +1,13 @@ 1.4 +# Raise an instance of TypeError. 1.5 + 1.6 +try: 1.7 + raise TypeError() 1.8 +except TypeError, exc: 1.9 + print "Handled", exc 1.10 + 1.11 +# Raise TypeError, causing instantiation. 1.12 + 1.13 +try: 1.14 + raise TypeError 1.15 +except TypeError, exc: 1.16 + print "Handled", exc