diff --git a/pycodestyle.py b/pycodestyle.py index 868e79d5..eea27fbe 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -1518,7 +1518,7 @@ def bare_except(logical_line, noqa): Okay: except Exception: Okay: except BaseException: - E722: except: + E722: except Exception: """ if noqa: return diff --git a/testing/data/E72.py b/testing/data/E72.py index 5d1046cb..6275e1ee 100644 --- a/testing/data/E72.py +++ b/testing/data/E72.py @@ -55,14 +55,14 @@ def func_histype(a, b, c): #: E722 try: pass -except: +except Exception: pass #: E722 try: pass except Exception: pass -except: +except Exception: pass #: E722 E203 E271 try: @@ -73,7 +73,7 @@ def func_histype(a, b, c): fake_code = """" try: do_something() -except: +except Exception: pass """ try: diff --git a/testing/data/E90.py b/testing/data/E90.py index e0a10d04..ae71817d 100644 --- a/testing/data/E90.py +++ b/testing/data/E90.py @@ -4,7 +4,7 @@ while True: try: pass - except: + except Exception: print 'Whoops' #: Okay