overgeneral-exceptions doesn't work for exceptions outside builtins #7495
Labels
Bug 🪲
Configuration
Related to configuration
Enhancement ✨
Improvement to a component
Good first issue
Friendly and approachable by new contributors
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Bug description
Configuration
No response
Command used
Pylint output
************* Module repro repro.py:12:7: W0703: Catching too general exception Exception (broad-except) ------------------------------------------------------------------ Your code has been rated at 8.75/10 (previous run: 8.75/10, +0.00)
Expected behavior
I expected to get
broad-except
message for line 9 (which is not happening regardless of whetherexcept Exception
is there or not).This is also reproducible when making a whole package and referring to the exception class using
package.GeneralException
name (which I personally think would be the best way of specifying non-builtin exceptions).This seems to vastly limit the usefulness of
--overgeneral-exceptions
.Pylint version
OS / Environment
Kubuntu 22.04.1 LTS
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: