Skip to content

Commit

Permalink
ast_with: call __enter__ even without target; see #581
Browse files Browse the repository at this point in the history
  • Loading branch information
dmamelin committed Feb 1, 2024
1 parent d16df0c commit 43572ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/pyscript/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -1310,8 +1310,8 @@ async def ast_with(self, arg, async_attr=""):
}
)
for ctx in ctx_list:
value = await self.call_func(ctx["enter"], enter_attr, ctx["manager"])
if ctx["target"]:
value = await self.call_func(ctx["enter"], enter_attr, ctx["manager"])
await self.recurse_assign(ctx["target"], value)
for arg1 in arg.body:
val = await self.aeval(arg1)
Expand Down

0 comments on commit 43572ce

Please sign in to comment.