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):
|
if os.path.exists(tzpath):
|
||||||
try:
|
try:
|
||||||
_, tz = tzpath.split(zoneinfo_path)
|
_, tz = tzpath.split(zoneinfo_path)
|
||||||
except:
|
except BaseException:
|
||||||
pass
|
pass
|
||||||
if tz:
|
if tz:
|
||||||
logging.info(f"Your host timezone: {tz}")
|
logging.info(f"Your host timezone: {tz}")
|
||||||
|
|
|
@ -33,8 +33,7 @@ line-length=100
|
||||||
# Assume Python 3.9
|
# Assume Python 3.9
|
||||||
target-version = "py39"
|
target-version = "py39"
|
||||||
# E402: module import not on top of file, not possible for testcases
|
# E402: module import not on top of file, not possible for testcases
|
||||||
# E722: do not use bare except
|
lint.ignore=["E402"]
|
||||||
lint.ignore=["E402", "E722"]
|
|
||||||
|
|
||||||
[tool.ruff.lint.extend-per-file-ignores]
|
[tool.ruff.lint.extend-per-file-ignores]
|
||||||
# F401: imported but unused, common for __init__.py files
|
# F401: imported but unused, common for __init__.py files
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue