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
When using driver/parser without a custom convert function (like pyconvert.convert), it tries to assign used_names to the root node, which can be anything depending on the given convert function. If none given, it will be a tuple.
>>> from lib2to3.pygram import python_grammar
>>> from lib2to3.pgen2.driver import Driver
>>>
>>> d = Driver(grammar=python_grammar)
>>> d.parse_string("test\n")
Traceback (most recent call la
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/lib2to3/pgen2/driver.py", line 103, in parse_string
return self.parse_tokens(tokens, debug)
File "/usr/local/lib/python3.9/lib2to3/pgen2/driver.py", line 71, in parse_tokens
if p.addtoken(type, value, (prefix, start)):
File "/usr/local/lib/python3.9/lib2to3/pgen2/parse.py", line 136, in addtoken
self.pop()
File "/usr/local/lib/python3.9/lib2to3/pgen2/parse.py", line 204, in pop
self.rootnode.used_names = self.used_names
AttributeError: 'tuple' object has no attribute 'used_names'
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: