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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user