Skip to content

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

Merged
lukpueh merged 1 commit into
theupdateframework:developfrom
sechkova:raise-missing-from
Aug 24, 2020
Merged

lukpueh merged 1 commit into
theupdateframework:developfrom
sechkova:raise-missing-from

Conversation

@sechkova

Copy link
Copy Markdown
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 <[email protected]>
@sechkova
sechkova force-pushed the raise-missing-from branch from e487b5f to 0ebe226 Compare August 24, 2020 10:44

@jku jku left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

lukpueh pushed 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 <[email protected]>

@lukpueh lukpueh left a comment

Copy link
Copy Markdown
Member

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