Skip to content

Fix try except pass #276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
galenseilis opened this issue Apr 9, 2025 · 1 comment
Open

Fix try except pass #276

galenseilis opened this issue Apr 9, 2025 · 1 comment

Comments

@galenseilis
Copy link
Contributor

There is the following lines of code in import_params.py.

Image

Generally "bare excepts" like this are discouraged:

There is even PEP760 which proposes disallowing them altogether.

https://peps.python.org/pep-0760/

I suggest we find out what all the branches are and treat them explicitly instead of a catch-all try except.

@galenseilis
Copy link
Contributor Author

Not only is it a bare except, but it is also letting w/e exceptions occur to pass silently:

https://stackoverflow.com/questions/21553327/why-is-except-pass-a-bad-programming-practice

https://peps.python.org/pep-0020/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant