New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests fail with astroid 2.0.0 (needed for Python 3.7) #16
Comments
|
I've opened pylint-dev/astroid#557 for the recursion thing. |
|
The RecursionError is not a big deal and the test should be removed according to astroid developers. |
keszybz
added a commit
to keszybz/asttokens
that referenced
this issue
Jul 5, 2018
astroid 2.0 will attempt to import typed_ast.ast3 and typed_ast.ast27, and then will fall back to plain ast if that fails. This patch adds a single import site for ast/typed_ast, and then just loads the result from other places. Fixes most of the errors in gristlabs#16, all similar to: ERROR: test_calling_lambdas (tests.test_astroid.TestAstroid) ---------------------------------------------------------------------- Traceback (most recent call last): File ".../asttokens/tests/test_mark_tokens.py", line 345, in test_calling_lambdas m.verify_all_nodes(self) File ".../asttokens/tests/tools.py", line 129, in verify_all_nodes test_case.assertEqual(to_source(rebuilt_node), to_source(node)) File ".../asttokens/tests/tools.py", line 59, in to_source anode = builder.visit_module(node_copy, '', '', '') File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in visit_module newnode.postinit([self.visit(child, newnode) for child in node.body]) File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 152, in <listcomp> newnode.postinit([self.visit(child, newnode) for child in node.body]) File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit return visit_method(node, parent) File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 268, in visit_assign value=self.visit(node.value, newnode), File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit return visit_method(node, parent) File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 345, in visit_call newnode.postinit(self.visit(node.func, newnode), File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit return visit_method(node, parent) File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 623, in visit_lambda self.visit(node.body, newnode)) File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 164, in visit return visit_method(node, parent) File ".../asttokens/.tox/py36/lib/python3.6/site-packages/astroid/rebuilder.py", line 296, in visit_binop newnode = nodes.BinOp(self._bin_op_classes[type(node.op)], KeyError: <class '_ast.Add'> self._bin_op_classes contains '_ast3.Add', i.e. typed_ast._ast3.Add instead.
This was referenced Jul 5, 2018
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Astroid 2.0.0devX is the first astroid to support Python 3.7 at all, so the only way to use asttokens on Python 3.7 is with astroid 2.0.0, but that doesn't work:
$ tox --pre -r -e py36$ tox --pre -r -e py37The text was updated successfully, but these errors were encountered: