File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1005,7 +1005,9 @@ impl ExecutingFrame<'_> {
10051005 }
10061006 bytecode:: Instruction :: EndAsyncFor => {
10071007 let exc = self . pop_value ( ) ;
1008- self . pop_value ( ) ; // async iterator we were calling __anext__ on
1008+ let except_block = self . pop_block ( ) ; // pushed by TryExcept unwind
1009+ debug_assert_eq ! ( except_block. level, self . state. stack. len( ) ) ;
1010+ let _async_iterator = self . pop_value ( ) ; // __anext__ provider in the loop
10091011 if exc. fast_isinstance ( vm. ctx . exceptions . stop_async_iteration ) {
10101012 vm. take_exception ( ) . expect ( "Should have exception in stack" ) ;
10111013 Ok ( None )
@@ -1932,6 +1934,7 @@ impl ExecutingFrame<'_> {
19321934 }
19331935
19341936 #[ inline]
1937+ #[ track_caller] // not a real track_caller but push_value is not very useful
19351938 fn push_value ( & mut self , obj : PyObjectRef ) {
19361939 match self . state . stack . try_push ( obj) {
19371940 Ok ( ( ) ) => { }
You can’t perform that action at this time.
0 commit comments