Skip to content

Astroid version 2.2 (with pylint 2.2) is causing exceptions #649

@jan11011977

Description

@jan11011977

A new version of astroid was just deployed which is causing pylint to crash. I have Pylint pinned to version 2.2.2. but I hadn't pinned astroid, so that package was upgraded to 2.2.0. This then caused the crash:

PS D:\shared\python\ctn-compass> D:\shared.venv3.7.1\python\ctn-compass\scripts\pylint --rcfile=..\pylintrc src
Traceback (most recent call last):
File "d:\shared.venv3.7.1\python\ctn-compass\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "d:\shared.venv3.7.1\python\ctn-compass\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "D:\shared.venv3.7.1\python\ctn-compass\scripts\pylint.exe_main
.py", line 9, in
File "d:\shared.venv3.7.1\python\ctn-compass\lib\site-packages\pylint_init
.py", line 20, in run_pylint
Run(sys.argv[1:])
File "d:\shared.venv3.7.1\python\ctn-compass\lib\site-packages\pylint\lint.py", line 1608, in init
linter.check(args)
File "d:\shared.venv3.7.1\python\ctn-compass\lib\site-packages\pylint\lint.py", line 938, in check
self._do_check(files_or_modules)
File "d:\shared.venv3.7.1\python\ctn-compass\lib\site-packages\pylint\lint.py", line 1071, in _do_check
self.check_astroid_module(ast_node, walker, rawcheckers, tokencheckers)
File "d:\shared.venv3.7.1\python\ctn-compass\lib\site-packages\pylint\lint.py", line 1154, in check_astroid_module
walker.walk(ast_node)
File "d:\shared.venv3.7.1\python\ctn-compass\lib\site-packages\pylint\utils.py", line 1269, in walk
self.walk(child)
File "d:\shared.venv3.7.1\python\ctn-compass\lib\site-packages\pylint\utils.py", line 1266, in walk
cb(astroid)
File "d:\shared.venv3.7.1\python\ctn-compass\lib\site-packages\pylint\checkers\variables.py", line 1582, in visit_import
module = next(node.infer_name_module(parts[0]))
AttributeError: 'Import' object has no attribute 'infer_name_module'

Maybe astroid version 2.2.0 is incompabitl with pylint 2.2.2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions