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

Re-raise exceptions explicitly using the 'from' keyword #1116

Merged
merged 1 commit into from
Aug 24, 2020

Conversation

sechkova
Copy link
Contributor

Fixes issue #: #1115

Description of the changes being introduced by the pull request:

Versions 2.6.0 and later of pylint adhere to PEP 3134 and trigger a 'raise-missing-from' warning (W0707) when chained exceptions are raised implicitly.

The 'from' keyword is a Python3.x feature, that is why six.raise_from is used for Python2.x compatibility.

Please verify and check that the pull request fulfills the following
requirements
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

Versions 2.6.0 and later of pylint adhere to PEP 3134
and trigger a 'raise-missing-from' warning (W0707) when
chained exceptions are raised implicitly.

The 'from' keyword is a Python3.x feature, that is why
six.raise_from is used for Python2.x compatibility.

Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
Copy link
Member

@jku jku left a comment

Choose a reason for hiding this comment

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

LGTM

lukpueh added a commit to lukpueh/in-toto that referenced this pull request Aug 24, 2020
Versions 2.6.0 and later of pylint adhere to PEP 3134
and trigger a 'raise-missing-from' warning (W0707) when
chained exceptions are raised implicitly.

The 'from' keyword is a Python3.x feature, that is why
six.raise_from is used for Python2.x compatibility.

Kudos to @sechkova and @jku for showing how to do this
(theupdateframework/python-tuf#1116).

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Copy link
Member

@lukpueh lukpueh left a comment

Choose a reason for hiding this comment

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

Thanks, @sechkova! LGTM. I borrowed your fix and commit message in in-toto/in-toto#387. I hope you don't mind. :)

@lukpueh lukpueh merged commit f54bbf5 into theupdateframework:develop Aug 24, 2020
@sechkova sechkova deleted the raise-missing-from branch August 24, 2020 13:19
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.

3 participants