Closed frmdstryr closed 2 months ago
Out of curiosity can you reproduce on 3.11 ? TryBegin was not introduced for 3.12 so I suspect the bug exists also on 3.11.
I agree that a simple isinstance
to check if we are dealing with an Instr
is the way to go here. Could you provide a reproducer even if it is not minimal.
I was able to reproduce it by inlining the Spec argument in the AutoFormBody from the templates/advanced.enaml
example
Eg replace
template AutoFormBody(ModelType):
const Spec: tuple = form_spec(ModelType)
ForEach(Spec, FormItem):
pass
with
template AutoFormBody(ModelType):
const Spec: tuple = tuple([
(name, type(member))
for name, member in ModelType.members().items()
if not name.startswith('_')
])
ForEach(Spec, FormItem):
pass
I cannot reproduce it with 3.11
Not sure how to reproduce in a test yet but it seems like an
isinstance(instr, bc.Instr)
check is needed inrewrite_to_fast_locals
.It is when generating templates.
enaml==0.17.0 bytecode==0.15.1