Skip to content
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

Do not use bare 'except:': flake8 --select=E722 #622

Merged
merged 2 commits into from
Aug 20, 2021

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Aug 20, 2021

Do not use bare except:, it also catches unexpected events like memory errors, interrupts, system exit, and so on. Prefer except Exception:. If you’re sure what you’re doing, be explicit and write except BaseException:.

https://realpython.com/the-most-diabolical-python-antipattern/
https://www.python.org/dev/peps/pep-0008/

@jtbandes jtbandes merged commit 9230ee5 into RobotWebTools:ros2 Aug 20, 2021
@cclauss cclauss deleted the bare-except branch August 20, 2021 23:52
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

Successfully merging this pull request may close these issues.

2 participants