blob: 70aba5cba1d6184c34b6a4948ccb0c39589e34cf [file] [log] [blame]
Tor Norbye3a2425a2013-11-04 10:16:08 -08001class ExceptionKlass(Exception):
2 pass
3
4try:
5 function_throws_exception()
6except <weak_warning descr="Too broad exception clause">Exception</weak_warning>:
7 pass
8
9try:
10 function_throws_exception()
11except <weak_warning descr="Too broad exception clause">BaseException</weak_warning>:
12 pass
13
14try:
15 function_throws_exception()
16except ExceptionKlass:
17 pass
18
19try:
20 function_throws_exception()
21<weak_warning descr="Too broad exception clause">except</weak_warning>:
22 pass
23
24class Exception:
25 pass
26
27try:
28 function_throws_exception()
29except Exception:
30 pass
31
32try:
33 doSomething()
34except:
35 someCleanup()
36 raise
37
38result = []
39
40## PY-2698
41try:
42 function_throws_exception()
43except Exception, e:
44 result.append(e)