Skip to content

Commit 255259e

Browse files
Apply ruff/pycodestyle rule E722
E722 Do not use bare `except`
1 parent f1b7a38 commit 255259e

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

src/cffi/backend_ctypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ def callback(*args):
866866
try:
867867
res2 = init(*args2)
868868
res2 = BResult._to_ctypes(res2)
869-
except:
869+
except Exception:
870870
traceback.print_exc()
871871
res2 = error
872872
if issubclass(BResult, CTypesGenericPtr):

testing/cffi0/test_verify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2106,7 +2106,7 @@ def _run_in_multiple_threads(test1):
21062106
def wrapper(lock):
21072107
try:
21082108
test1()
2109-
except:
2109+
except Exception:
21102110
errors.append(sys.exc_info())
21112111
lock.release()
21122112
locks = []

testing/cffi1/test_verify1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2071,7 +2071,7 @@ def _run_in_multiple_threads(test1):
20712071
def wrapper(lock):
20722072
try:
20732073
test1()
2074-
except:
2074+
except Exception:
20752075
errors.append(sys.exc_info())
20762076
lock.release()
20772077
locks = []

testing/udir.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ def try_remove_lockfile():
9797
pass # assume that it means that there is no 'lf'
9898
try:
9999
path.remove(rec=1)
100-
except KeyboardInterrupt:
101-
raise
102-
except: # this might be py.error.Error, WindowsError ...
100+
except Exception: # this might be py.error.Error, OSError ...
103101
pass
104102

105103
# make link...

0 commit comments

Comments
 (0)