diff --git a/test/bytecode_3.5/03_async_await.pyc b/test/bytecode_3.5/03_async_await.pyc index 5aeec7a3..c36dde67 100644 Binary files a/test/bytecode_3.5/03_async_await.pyc and b/test/bytecode_3.5/03_async_await.pyc differ diff --git a/test/simple_source/bug35/03_async_await.py b/test/simple_source/bug35/03_async_await.py index 38ae9da8..96fbb1bc 100644 --- a/test/simple_source/bug35/03_async_await.py +++ b/test/simple_source/bug35/03_async_await.py @@ -27,3 +27,6 @@ async def awith_as_test(): async def f(z): await z + +async def g(z): + return await z diff --git a/uncompyle6/parsers/parse35.py b/uncompyle6/parsers/parse35.py index 0c7cc944..d9271618 100644 --- a/uncompyle6/parsers/parse35.py +++ b/uncompyle6/parsers/parse35.py @@ -27,8 +27,12 @@ class Python35Parser(Python34Parser): POP_BLOCK else_suite COME_FROM_LOOP # Python 3.5+ Await statement + expr ::= await_expr + await_expr ::= expr GET_AWAITABLE LOAD_CONST YIELD_FROM + stmt ::= await_stmt - await_stmt ::= expr GET_AWAITABLE LOAD_CONST YIELD_FROM POP_TOP + await_stmt ::= await_expr POP_TOP + # Python 3.5+ has WITH_CLEANUP_START/FINISH diff --git a/uncompyle6/semantics/pysource.py b/uncompyle6/semantics/pysource.py index 46647873..117cba13 100644 --- a/uncompyle6/semantics/pysource.py +++ b/uncompyle6/semantics/pysource.py @@ -335,7 +335,8 @@ class SourceWalker(GenericASTTraversal, object): ####################### if version >= 3.5: TABLE_DIRECT.update({ - 'await_stmt': ( '%|await %c', 0), + 'await_expr': ( 'await %c', 0), + 'await_stmt': ( '%|%c', 0), 'async_for_stmt': ( '%|async for %c in %c:\n%+%c%-\n\n', 9, 1, 25 ), 'async_forelse_stmt': (