forked from Mirror/pmbootstrap
Do not use bare except (MR 2325)
A bare except catches things like ctrl+c (KeyboardInterrupt). If don't want to catch this exception. Remove the bare except and restore the default lint.
This commit is contained in:
parent
cb4aa809e1
commit
8398bc1218
2 changed files with 2 additions and 3 deletions
|
@ -263,7 +263,7 @@ def ask_for_timezone():
|
|||
if os.path.exists(tzpath):
|
||||
try:
|
||||
_, tz = tzpath.split(zoneinfo_path)
|
||||
except:
|
||||
except BaseException:
|
||||
pass
|
||||
if tz:
|
||||
logging.info(f"Your host timezone: {tz}")
|
||||
|
|
|
@ -33,8 +33,7 @@ line-length=100
|
|||
# Assume Python 3.9
|
||||
target-version = "py39"
|
||||
# E402: module import not on top of file, not possible for testcases
|
||||
# E722: do not use bare except
|
||||
lint.ignore=["E402", "E722"]
|
||||
lint.ignore=["E402"]
|
||||
|
||||
[tool.ruff.lint.extend-per-file-ignores]
|
||||
# F401: imported but unused, common for __init__.py files
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue