Skip to content

MAINT: fix overly broad exception handling listed in LGTM#19393

Merged
mattip merged 3 commits intonumpy:mainfrom
wandrewjam:remove-base-exception
Jul 5, 2021
Merged

MAINT: fix overly broad exception handling listed in LGTM#19393
mattip merged 3 commits intonumpy:mainfrom
wandrewjam:remove-base-exception

Conversation

@wandrewjam
Copy link
Copy Markdown
Contributor

Modified instances of except BaseException: and except: to catch narrower exception classes as suggested by LGTM.

Relates to ticket #19077

wandrewjam and others added 2 commits July 3, 2021 08:49
Co-authored-by: Matti Picus <matti.picus@gmail.com>
Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
Copy link
Copy Markdown
Member

@BvB93 BvB93 left a comment

Choose a reason for hiding this comment

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

LGTM, the test failure seems to be unrelated.

@mattip mattip merged commit 4fcea6d into numpy:main Jul 5, 2021
@mattip
Copy link
Copy Markdown
Member

mattip commented Jul 5, 2021

Thanks @wandrewjam and welcome.

@wandrewjam wandrewjam deleted the remove-base-exception branch July 5, 2021 19:06
@wandrewjam
Copy link
Copy Markdown
Contributor Author

Thanks very much for your help @mattip and @BvB93

seberg added a commit to seberg/numpy that referenced this pull request Sep 30, 2022
Some BaseExceptions (at least the Skipped that pytest uses) need to
be caught as well.  It seems easiest to be practical and keep ignoring
almost all exception in this particular code path.

Effectively reverts parts of numpygh-19393

Closes numpygh-22345
rossbar pushed a commit that referenced this pull request Oct 1, 2022
Some BaseExceptions (at least the Skipped that pytest uses) need to
be caught as well.  It seems easiest to be practical and keep ignoring
almost all exception in this particular code path.

Effectively reverts parts of gh-19393

Closes gh-22345

Co-authored-by: Sebastian Berg <sebastianb@nvidia.com>
charris pushed a commit to charris/numpy that referenced this pull request Oct 5, 2022
Some BaseExceptions (at least the Skipped that pytest uses) need to
be caught as well.  It seems easiest to be practical and keep ignoring
almost all exception in this particular code path.

Effectively reverts parts of numpygh-19393

Closes numpygh-22345

Co-authored-by: Sebastian Berg <sebastianb@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants