1 parent 4bcd04b commit 2234c3fCopy full SHA for 2234c3f
1 file changed
tests/basics/except_match_tuple.py
@@ -0,0 +1,21 @@
1
+# test exception matching against a tuple
2
+
3
+try:
4
+ fail
5
+except (Exception,):
6
+ print('except 1')
7
8
9
10
+except (Exception, Exception):
11
+ print('except 2')
12
13
14
15
+except (TypeError, NameError):
16
+ print('except 3')
17
18
19
20
+except (TypeError, ValueError, Exception):
21
+ print('except 4')
0 commit comments