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
I have encountered an error when using abstract properties and multiple inheritance. The code itself works in it returns a correct value but it seems that pylint tries to check the abstract property for return which it doesn't have, interestingly the same code without property works with pylint. Adding an empty return statement to C class also fixes this issue.
Traceback (most recent call last):
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/bin/pylint", line 8, in <module>
sys.exit(run_pylint())
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/pylint/__init__.py", line 22, in run_pylint
PylintRun(sys.argv[1:])
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/pylint/lint/run.py", line 338, in __init__
linter.check(args)
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/pylint/lint/pylinter.py", line 871, in check
self.get_ast, self._iterate_file_descrs(files_or_modules)
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/pylint/lint/pylinter.py", line 904, in _check_files
self._check_file(get_ast, check_astroid_module, name, filepath, modname)
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/pylint/lint/pylinter.py", line 930, in _check_file
check_astroid_module(ast_node)
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/pylint/lint/pylinter.py", line 1063, in check_astroid_module
ast_node, walker, rawcheckers, tokencheckers
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/pylint/lint/pylinter.py", line 1107, in _check_astroid_module
walker.walk(ast_node)
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/pylint/utils/ast_walker.py", line 75, in walk
self.walk(child)
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/pylint/utils/ast_walker.py", line 75, in walk
self.walk(child)
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/pylint/utils/ast_walker.py", line 75, in walk
self.walk(child)
[Previous line repeated 2 more times]
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/pylint/utils/ast_walker.py", line 72, in walk
callback(astroid)
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/pylint/checkers/typecheck.py", line 958, in visit_attribute
for n in owner.getattr(node.attrname)
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/astroid/objects.py", line 206, in getattr
return list(self.igetattr(name, context=context))
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/astroid/objects.py", line 190, in igetattr
yield from function.infer_call_result(caller=self, context=context)
File "/home/phala/.local/share/virtualenvs/3scale-py-testsuite-FxueJDku/lib/python3.6/site-packages/astroid/scoped_nodes.py", line 1714, in infer_call_result
"The function does not have any return statements"
astroid.exceptions.InferenceError: The function does not have any return statements
Expected behavior
To only report linting errors
pylint --version output
pylint 2.5.0
astroid 2.4.0
Python 3.6.10 (default, Dec 20 2019, 00:00:00)
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)]
The text was updated successfully, but these errors were encountered:
pehala
changed the title
Abstract properties with multiple inheritance fails in pylint 2.5.0
Missing return in abstract property fails in pylint 2.5.0
Apr 27, 2020
…n `Super.getattr()`
``infer_call_result`` can raise InferenceError but we were not handling that when retrieving
objects from the Super instance.
Closepylint-dev/pylint#3529
…n `Super.getattr()` (#782)
``infer_call_result`` can raise InferenceError but we were not handling that when retrieving
objects from the Super instance.
Closepylint-dev/pylint#3529
I have encountered an error when using abstract properties and multiple inheritance. The code itself works in it returns a correct value but it seems that pylint tries to check the abstract property for return which it doesn't have, interestingly the same code without property works with pylint. Adding an empty return statement to C class also fixes this issue.
Steps to reproduce
Sample Code:
Current behavior
Expected behavior
To only report linting errors
pylint --version output
The text was updated successfully, but these errors were encountered: