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<'_> {
1005
1005
}
1006
1006
bytecode:: Instruction :: EndAsyncFor => {
1007
1007
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
1009
1011
if exc. fast_isinstance ( vm. ctx . exceptions . stop_async_iteration ) {
1010
1012
vm. take_exception ( ) . expect ( "Should have exception in stack" ) ;
1011
1013
Ok ( None )
@@ -1932,6 +1934,7 @@ impl ExecutingFrame<'_> {
1932
1934
}
1933
1935
1934
1936
#[ inline]
1937
+ #[ track_caller] // not a real track_caller but push_value is not very useful
1935
1938
fn push_value ( & mut self , obj : PyObjectRef ) {
1936
1939
match self . state . stack . try_push ( obj) {
1937
1940
Ok ( ( ) ) => { }
You can’t perform that action at this time.
0 commit comments