Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions custom_components/pyscript/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -2020,10 +2020,7 @@ async def ast_formattedvalue(self, arg):

async def ast_await(self, arg):
"""Evaluate await expr."""
coro = await self.aeval(arg.value)
if coro:
return await coro
return None
return await self.aeval(arg.value)

async def get_target_names(self, lhs):
"""Recursively find all the target names mentioned in the AST tree."""
Expand Down
9 changes: 9 additions & 0 deletions tests/test_unit_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,15 @@ def bar():
""",
["bar"],
],
[
"""
async def func():
return 42

await func()
""",
42,
],
]


Expand Down
Loading