Closed cdeil closed 6 years ago
I still get the same error after pip install pylint astroid --pre -U
:
https://gist.github.com/cdeil/d82b9c8a058d9a85d53f3d0654500b40
Thanks for creating an issue! This should be fixed now in astroid's master.
@PCManticore - Wow, you fix bugs in < 1 hour after they are reported. Thanks!
Is a bugfix release coming up in the next days, or should I install master?
No worries, thanks for the clear report! Probably not this week, so feel free to use master in the meantime, but the plan is to have a pylint 2.2 release by the end of the month.
This doesn't appear to have been fixed. I'm running the latest astroid master (commit 1f0eff526dcc3dea0af68288c719d23767bd2581) and I get
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/.../pylint/pylint/__main__.py", line 7, in <module>
pylint.run_pylint()
File "/home/.../pylint/pylint/__init__.py", line 19, in run_pylint
Run(sys.argv[1:])
File "/home/.../pylint/pylint/lint.py", line 1394, in __init__
linter.check(args)
File "/home/.../pylint/pylint/lint.py", line 801, in check
self._do_check(files_or_modules)
File "/home/.../pylint/pylint/lint.py", line 938, in _do_check
self.check_astroid_module(ast_node, walker, rawcheckers, tokencheckers)
File "/home/.../pylint/pylint/lint.py", line 1018, in check_astroid_module
walker.walk(ast_node)
File "/home/.../pylint/pylint/utils.py", line 1162, in walk
self.walk(child)
File "/home/.../pylint/pylint/utils.py", line 1159, in walk
cb(astroid)
File "/home/.../pylint/pylint/checkers/exceptions.py", line 406, in visit_tryexcept
self._check_try_except_raise(node)
File "/home/.../pylint/pylint/checkers/exceptions.py", line 384, in _check_try_except_raise
inferred_current = utils.safe_infer(exc_in_current_handler)
File "/home/.../pylint/pylint/checkers/utils.py", line 867, in safe_infer
value = next(inferit)
TypeError: 'Uninferable' object is not an iterator
When running pylint on
import asyncio
try:
pass
except invalid_name:
raise
except asyncio.CancelledError:
pass
And almost identical traceback (only last line differs)
File "/home/.../pylint/pylint/checkers/utils.py", line 866, in safe_infer
inferit = node.infer(context=context)
AttributeError: 'NoneType' object has no attribute 'infer'
running pylint on
try:
pass
except invalid_name:
raise
except invalid_name:
pass
@Hornwitser From the stack trace, this looks like a completely different problem, albeit involving the same Uninferable object.
@Hornwitser The linked pylint commit should fix the problem for you. Make sure to get the latest pylint from github.
Oh, it looked the same to me. Sorry about that. The latest master works, thanks :+1:.
I'm getting this error:
Version:
This should let you reproduce: