-
Notifications
You must be signed in to change notification settings - Fork 903
/
ruff_linter__rules__flake8_bugbear__tests__B014_B014.py.snap
105 lines (94 loc) · 2.38 KB
/
ruff_linter__rules__flake8_bugbear__tests__B014_B014.py.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
---
B014.py:17:8: B014 [*] Exception handler with duplicate exception: `OSError`
|
15 | try:
16 | pass
17 | except (OSError, OSError) as err:
| ^^^^^^^^^^^^^^^^^^ B014
18 | # Duplicate exception types are useless
19 | pass
|
= help: De-duplicate exceptions
ℹ Fix
14 14 |
15 15 | try:
16 16 | pass
17 |-except (OSError, OSError) as err:
17 |+except OSError as err:
18 18 | # Duplicate exception types are useless
19 19 | pass
20 20 |
B014.py:28:8: B014 [*] Exception handler with duplicate exception: `MyError`
|
26 | try:
27 | pass
28 | except (MyError, MyError):
| ^^^^^^^^^^^^^^^^^^ B014
29 | # Detect duplicate non-builtin errors
30 | pass
|
= help: De-duplicate exceptions
ℹ Fix
25 25 |
26 26 | try:
27 27 | pass
28 |-except (MyError, MyError):
28 |+except MyError:
29 29 | # Detect duplicate non-builtin errors
30 30 | pass
31 31 |
B014.py:49:8: B014 [*] Exception handler with duplicate exception: `re.error`
|
47 | try:
48 | pass
49 | except (re.error, re.error):
| ^^^^^^^^^^^^^^^^^^^^ B014
50 | # Duplicate exception types as attributes
51 | pass
|
= help: De-duplicate exceptions
ℹ Fix
46 46 |
47 47 | try:
48 48 | pass
49 |-except (re.error, re.error):
49 |+except re.error:
50 50 | # Duplicate exception types as attributes
51 51 | pass
52 52 |
B014.py:82:8: B014 [*] Exception handler with duplicate exception: `ValueError`
|
80 | try:
81 | pass
82 | except (ValueError, ValueError, TypeError):
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B014
83 | pass
|
= help: De-duplicate exceptions
ℹ Fix
79 79 | # Regression test for: https://github.com/astral-sh/ruff/issues/6412
80 80 | try:
81 81 | pass
82 |-except (ValueError, ValueError, TypeError):
82 |+except (ValueError, TypeError):
83 83 | pass
84 84 |
85 85 |
B014.py:89:7: B014 [*] Exception handler with duplicate exception: `re.error`
|
87 | try:
88 | pas
89 | except(re.error, re.error):
| ^^^^^^^^^^^^^^^^^^^^ B014
90 | p
|
= help: De-duplicate exceptions
ℹ Fix
86 86 | # Regression test for: https://github.com/astral-sh/ruff/issues/7455#issuecomment-1739801758
87 87 | try:
88 88 | pas
89 |-except(re.error, re.error):
89 |+except re.error:
90 90 | p