You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pylint crashed with a ``AstroidError`` and with the following stacktrace:
Exception on node <Compare l.10 at 0x103257ed0>in file '.../tmp.py'
Traceback (most recent call last):
File "/.../pylint/checkers/utils.py", line 1390, in safe_infer
value = next(infer_gen)
^^^^^^^^^^^^^^^
File "/.../astroid/nodes/node_ng.py", line 171, in infer
yield from self._infer(context=context, **kwargs)
File "/.../astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/.../astroid/decorators.py", line 112, in wrapped
forresin _func(node, context, **kwargs):
File "/.../astroid/inference.py", line 372, in infer_attribute
yield from owner.igetattr(self.attrname, context)
File "/.../astroid/nodes/scoped_nodes/scoped_nodes.py", line 2650, in igetattr
first_scope = first_attr.scope()
^^^^^^^^^^^^^^^^^^
File "/.../astroid/nodes/node_ng.py", line 362, in scope
raise ParentMissingError(target=self)
astroid.exceptions.ParentMissingError: Parent not found on <Const.str l.None at 0x103a58dd0>.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/.../pylint/utils/ast_walker.py", line 91, in walk
callback(astroid)
File "/.../pylint/checkers/base/comparison_checker.py", line 298, in visit_compare
self._check_callable_comparison(node)
File "/.../pylint/checkers/base/comparison_checker.py", line 276, in _check_callable_comparison
inferred = utils.safe_infer(operand)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.../pylint/checkers/utils.py", line 1394, in safe_infer
raise AstroidError from e
astroid.exceptions.AstroidError
************* Module tmp
tmp.py:1:0: F0002: tmp.py: Fatal error while checking 'tmp.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in'/.../pylint/pylint-crash-2023-08-03-14-41-00.txt'. (astroid-error)
Bug description
Pylint crashes when comparing to
__name__
on a Protocol.Also applies to subclasses of the Protocol.
Command used
Pylint output
Expected behavior
No crash
Pylint version
OS / Environment
OS: MacOS 13.4.1
Virtualenv: Created by poetry 1.5.1
The text was updated successfully, but these errors were encountered: