Search code examples
pythonpylint

Pylint: Specifying exception names in the overgeneral-exceptions option without module name is deprecated


pylint: Command line or configuration file:1: UserWarning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated and support for it will be removed in pylint 3.0. Use fully qualified name (maybe 'builtins.BaseException' ?) instead.

Getting PyLint error. I dont have any Except clause in my file and yet I see this error.


Solution

  • This is just a warning for future pylint releases, you can ignore it. If you want to address it now you will need to open your .pylintrc configuration file (should be located at ~/.pylintrc) and replace:

    overgeneral-exceptions=BaseException,
                           Exception
    

    with:

    overgeneral-exceptions=builtins.BaseException,
                           builtins.Exception