logilab-astng #83749 logilab-astng / pylint: "TypeError: _Yes object is not an iterator" with Python 3 [validation pending]
I don't know if it's a bug in logilab-astng or pylint. I use logilab-common 0.57.1, logilab-astng 0.23.0 and pylint 0.25.0. $ cat test.py try: from pickle import PickleError except ImportError: from nonexistent import PickleError try: pass except PickleError: pass $ pylint-3.2 test.py No config file found, using default configuration ************* Module test C: 1,0: Missing docstring F: 4,4: Unable to import 'nonexistent' Traceback (most recent call last): File "/usr/bin/pylint-3.2", line 4, in <module> lint.Run(sys.argv[1:]) File "/usr/lib64/python3.2/site-packages/pylint/lint.py", line 874, in __init__ linter.check(args) File "/usr/lib64/python3.2/site-packages/pylint/lint.py", line 496, in check self.check_astng_module(astng, walker, rawcheckers) File "/usr/lib64/python3.2/site-packages/pylint/lint.py", line 568, in check_astng_module walker.walk(astng) File "/usr/lib64/python3.2/site-packages/pylint/utils.py", line 528, in walk self.walk(child) File "/usr/lib64/python3.2/site-packages/pylint/utils.py", line 525, in walk cb(astng) File "/usr/lib64/python3.2/site-packages/pylint/checkers/exceptions.py", line 162, in visit_tryexcept excs = list(unpack_infer(handler.type)) File "/usr/lib64/python3.2/site-packages/logilab/astng/node_classes.py", line 47, in unpack_infer for inf_inf in unpack_infer(infered, context): File "/usr/lib64/python3.2/site-packages/logilab/astng/node_classes.py", line 42, in unpack_infer infered = next(stmt.infer(context)) TypeError: _Yes object is not an iterator Such imports can be needed for support for different Python versions. Example: try: # Python 3 from http.client import HTTPException except ImportError: # Python 2 from httplib import HTTPException | |
priority | important |
---|---|
type | bug |
done in | 0.24.1 |
load left | 0.000 |
closed by | #394a0b80b094 Fix python 3 crash on importing from a non existing module. Closes #83749 |
similar entities
- logilab-astng #83138 AttributeError: Starred object has no attribute 'ass_type'
- logilab-common #53393 python3: fix tests and run them also during build
- logilab-common #104047 Tests fails when run under python3
- logilab-common #120897 Installation fails on Python 3.3
- pylint #110213 "No such message id W0704" when using Python 3.3
[see all]
Comments
-
2012/01/19 15:42, written by sthenault
-
2012/10/09 00:32, written by Arfrever
add commentreproduced
The fix works for me.