Skip to content

Commit e7a1bd7

Browse files
author
haosenwang1018
committed
fix: replace 5 bare except clauses with except Exception
1 parent 8b53059 commit e7a1bd7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

pycodestyle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ def bare_except(logical_line, noqa):
15181518
15191519
Okay: except Exception:
15201520
Okay: except BaseException:
1521-
E722: except:
1521+
E722: except Exception:
15221522
"""
15231523
if noqa:
15241524
return

testing/data/E72.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ def func_histype(a, b, c):
5555
#: E722
5656
try:
5757
pass
58-
except:
58+
except Exception:
5959
pass
6060
#: E722
6161
try:
6262
pass
6363
except Exception:
6464
pass
65-
except:
65+
except Exception:
6666
pass
6767
#: E722 E203 E271
6868
try:
@@ -73,7 +73,7 @@ def func_histype(a, b, c):
7373
fake_code = """"
7474
try:
7575
do_something()
76-
except:
76+
except Exception:
7777
pass
7878
"""
7979
try:

testing/data/E90.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
while True:
55
try:
66
pass
7-
except:
7+
except Exception:
88
print 'Whoops'
99
#: Okay
1010

0 commit comments

Comments
 (0)