Skip to content

Commit 0f61f5f

Browse files
Use specific exception instead of bare except in build_ffi.py
A bare except catches BaseException which includes KeyboardInterrupt, SystemExit, Exception, and others. Catching BaseException can make it hard to interrupt the program (e.g., with Ctrl-C) and can disguise other problems.
1 parent ec8ce54 commit 0f61f5f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/build_ffi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def checkout_version(version):
133133
current = subprocess.check_output(
134134
["git", "describe", "--all", "--exact-match"]
135135
).strip().decode().split('/')[-1]
136-
except:
136+
except subprocess.CalledProcessError:
137137
pass
138138

139139
if current != version:

0 commit comments

Comments
 (0)