1# Tests that the pending exception state is managed correctly 2# (previously failed on native emitter). 3 4def noop_task(): 5 print('noop task') 6 yield 1 7 8def raise_task(): 9 print('raise task') 10 yield 2 11 print('raising') 12 raise Exception 13 14def main(): 15 try: 16 yield from raise_task() 17 except: 18 print('main exception') 19 20 yield from noop_task() 21 22for z in main(): 23 print('outer iter', z) 24