diff options
Diffstat (limited to 'test/input/func_catching_non_exception.py')
-rw-r--r-- | test/input/func_catching_non_exception.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/input/func_catching_non_exception.py b/test/input/func_catching_non_exception.py index e6bfc57..d8e0e2d 100644 --- a/test/input/func_catching_non_exception.py +++ b/test/input/func_catching_non_exception.py @@ -1,5 +1,6 @@ """test non-exceptions catched """ +import socket __revision__ = 1 @@ -19,6 +20,16 @@ class MySecondGoodException(MyGoodException): """ custom 'exception' """ pass +class SkipException(socket.error): + """ This gave false positives for Python 2, + but not for Python 3, due to exception + hierarchy rewrite. + """ + +class SecondSkipException(SkipException): + """ This too shouldn't give false + positives. """ + try: 1 + 1 except MyException: @@ -39,3 +50,7 @@ try: except (MyGoodException, MySecondGoodException): print "should work" +try: + 1 + 3 +except (SkipException, SecondSkipException): + print "should work" |