Repository navigation
Expanding blind-except to contextlib.suppress
#29646
jenstroeger
started this conversation in
Ideas
Replies: 1 comment
|
Yeah, I think this could be a reasonable expansion to the rule. It came up before in #19306. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Following up on pylint-dev/pylint#11718, and somewhat related to blind-except and suppressible-exception.
While cleaning up a larger code base I noticed the occasional use of contextlib.suppress() with a “broad exception”:
While seek() isn’t documented to raise any exception, I noticed this pattern in several places.
Would it not make sense to consider this a case of “Catching too general exception” (pylint W0718) as part of
blind-exceptorsuppressible-exceptionas well, and shouldn’t ruff point this out?Thanks!
All reactions