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

Chain exception correctly #1015

Merged
merged 1 commit into from
Oct 10, 2021
Merged

Chain exception correctly #1015

merged 1 commit into from
Oct 10, 2021

Conversation

oncleben31
Copy link
Contributor

According to https://docs.python.org/3/tutorial/errors.html#exception-chaining
And to avoid the error B904 when you will bump flake8-bugbear to a version > 21.9.1, we have to use raise ... from err or raise ... from None.

As the SysExit() Exception is used I think there is no need to display the exceptions chain. So I propose to use from None.

According to https://docs.python.org/3/tutorial/errors.html#exception-chaining
And to avoid the error B904 when you will bump flake8-bugbear to a version > 21.9.1, we have to use `raise ... from err` or `raise ... from None`.

As the SysExit() Exception is used I think there is no need to display the exceptions chain. So I propose to use `from None`.
Copy link
Owner

@cjolowicz cjolowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@cjolowicz cjolowicz merged commit b8ff149 into cjolowicz:main Oct 10, 2021
@oncleben31 oncleben31 deleted the patch-1 branch October 10, 2021 20:44
@cjolowicz cjolowicz mentioned this pull request Nov 8, 2021
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.

None yet

2 participants