mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
py/emitnative: Fix native async with.
The code generating the entry to the finally handler of an async-with statement was simply wrong for the case of the native emitter. Among other things the layout of the stack was incorrect. This is fixed by this commit. The setup of the async-with finally handler is now put in a dedicated emit function, for both the bytecode and native emitters to implement in their own way (the bytecode emitter is unchanged, just factored to a function). With this fix all of the async-with tests now work when using the native emitter. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -717,9 +717,6 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
|
||||
# Remove them from the below when they work
|
||||
if args.emit == "native":
|
||||
skip_tests.add("basics/gen_yield_from_close.py") # require raise_varargs
|
||||
skip_tests.update(
|
||||
{"basics/async_%s.py" % t for t in "with with2 with_break with_return".split()}
|
||||
) # require async_with
|
||||
skip_tests.update(
|
||||
{"basics/%s.py" % t for t in "try_reraise try_reraise2".split()}
|
||||
) # require raise_varargs
|
||||
@@ -731,7 +728,6 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
|
||||
skip_tests.add("basics/sys_tracebacklimit.py") # requires traceback info
|
||||
skip_tests.add("basics/try_finally_return2.py") # requires raise_varargs
|
||||
skip_tests.add("basics/unboundlocal.py") # requires checking for unbound local
|
||||
skip_tests.add("extmod/asyncio_lock.py") # requires async with
|
||||
skip_tests.add("misc/features.py") # requires raise_varargs
|
||||
skip_tests.add(
|
||||
"misc/print_exception.py"
|
||||
|
||||
Reference in New Issue
Block a user