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).
This commit is contained in:
Damien George
2016-09-28 11:52:13 +10:00
parent 443cc0114d
commit b32c01b748
5 changed files with 33 additions and 10 deletions

View File

@@ -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')