diff options
author | Damien George <damien.p.george@gmail.com> | 2016-09-28 11:52:13 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-09-28 11:52:13 +1000 |
commit | b32c01b7489f233ae7b1c211a8b93e23149fb0f3 (patch) | |
tree | 23a03c04dd038925e6c5990e437ad1689e08d0df /tests/basics/async_with.py | |
parent | 443cc0114d7669471e39661c97e2bad91c8eabb8 (diff) | |
download | micropython-b32c01b7489f233ae7b1c211a8b93e23149fb0f3.tar.gz micropython-b32c01b7489f233ae7b1c211a8b93e23149fb0f3.zip |
py/compile: Fix async-for/async-with to work with simpler exc on stack.
There is now just the exception instance on the stack when an exception is
raised, not the full (type, exc, traceback).
Diffstat (limited to 'tests/basics/async_with.py')
-rw-r--r-- | tests/basics/async_with.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/basics/async_with.py b/tests/basics/async_with.py index 742f9ba993..9eccfd816c 100644 --- a/tests/basics/async_with.py +++ b/tests/basics/async_with.py @@ -4,7 +4,7 @@ class AContext: async def __aenter__(self): print('enter') async def __aexit__(self, exc_type, exc, tb): - print('exit') + print('exit', exc_type, exc) async def f(): async with AContext(): @@ -15,3 +15,13 @@ try: o.send(None) except StopIteration: print('finished') + +async def g(): + async with AContext(): + raise ValueError('error') + +o = g() +try: + o.send(None) +except ValueError: + print('ValueError') |