Skip to content

AttributeError invoking macro in Python 3.9 / AST format change in 3.9 #20

@thirtythreeforty

Description

@thirtythreeforty

I get the following error:

../../../.cache/pypoetry/virtualenvs/sonata-gateware-XIV50XOX-py3.9/lib/python3.9/site-packages/mcpyrate/expander.py:144: in visit_Subscript
    tree = subscript.slice.value
E   AttributeError: 'BinOp' object has no attribute 'value'

when invoking a small macro:

@parametricmacro
def genlogic(tree, **kw):
    return q[6 * 7]

like this:

genlogic[foo]

There are a couple places in this file that do .value, not just here, and they also give this error on 3.9. The example works correctly on 3.7.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions