Crash 'FunctionDef' object has no attribute 'ancestors'
#9543
Labels
Duplicate 🐫
Duplicate of an already existing issue
Bug description
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 1034, in _check_files
self._check_file(get_ast, check_astroid_module, file)
File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 1069, in _check_file
check_astroid_module(ast_node)
File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 1203, in check_astroid_module
retval = self._check_astroid_module(
File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 1250, in _check_astroid_module
walker.walk(node)
File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 75, in walk
self.walk(child)
File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 75, in walk
self.walk(child)
File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 75, in walk
self.walk(child)
[Previous line repeated 1 more time]
File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 72, in walk
callback(astroid)
File "/usr/lib/python3/dist-packages/pylint/checkers/refactoring/implicit_booleaness_checker.py", line 110, in visit_call
mother_classes = self.base_classes_of_node(instance)
File "/usr/lib/python3/dist-packages/pylint/checkers/refactoring/implicit_booleaness_checker.py", line 214, in base_classes_of_node
return [instance.name] + [x.name for x in instance.ancestors()]
File "/usr/lib/python3/dist-packages/astroid/bases.py", line 134, in getattr
return getattr(self._proxied, name)
File "/usr/lib/python3/dist-packages/astroid/bases.py", line 134, in getattr
return getattr(self._proxied, name)
AttributeError: 'FunctionDef' object has no attribute 'ancestors'
Configuration
No response
Command used
Pylint output
Expected behavior
I would expect no crash
Pylint version
OS / Environment
Linux Mint 21.3 Virginia
base: Ubuntu 22.04 jammy
Additional dependencies
The text was updated successfully, but these errors were encountered: