@@ -10,7 +10,6 @@ use crate::{
1010 PyBaseException , PyBaseExceptionRef , PyBaseObject , PyCode , PyCoroutine , PyDict , PyDictRef ,
1111 PyFloat , PyFrozenSet , PyGenerator , PyInt , PyInterpolation , PyList , PyModule , PyProperty ,
1212 PySet , PySlice , PyStr , PyStrInterned , PyTemplate , PyTraceback , PyType , PyUtf8Str ,
13- asyncgenerator:: PyAsyncGenWrappedValue ,
1413 builtin_func:: PyNativeFunction ,
1514 descriptor:: { MemberGetter , PyMemberDescriptor , PyMethodDescriptor } ,
1615 frame:: stack_analysis,
@@ -3548,7 +3547,7 @@ impl ExecutingFrame<'_> {
35483547
35493548 Ok ( None )
35503549 }
3551- Instruction :: YieldValue { arg : oparg } => {
3550+ Instruction :: YieldValue { .. } => {
35523551 debug_assert ! (
35533552 self . localsplus
35543553 . stack_as_slice( )
@@ -3557,16 +3556,7 @@ impl ExecutingFrame<'_> {
35573556 . all( |sr| !sr. is_borrowed( ) ) ,
35583557 "borrowed refs on stack at yield point"
35593558 ) ;
3560- let value = self . pop_value ( ) ;
3561- // arg=0: direct yield (wrapped for async generators)
3562- // arg=1: yield from await/yield-from (NOT wrapped)
3563- let wrap = oparg. get ( arg) == 0 ;
3564- let value = if wrap && self . code . flags . contains ( bytecode:: CodeFlags :: COROUTINE ) {
3565- PyAsyncGenWrappedValue ( value) . into_pyobject ( vm)
3566- } else {
3567- value
3568- } ;
3569- Ok ( Some ( ExecutionResult :: Yield ( value) ) )
3559+ Ok ( Some ( ExecutionResult :: Yield ( self . pop_value ( ) ) ) )
35703560 }
35713561 Instruction :: Send { .. } => {
35723562 // (receiver, v -- receiver, retval)
@@ -5800,13 +5790,6 @@ impl ExecutingFrame<'_> {
58005790 let offset = ( self . lasti ( ) - 1 ) * 2 ;
58015791 monitoring:: fire_py_yield ( vm, self . code , offset, & value) ?;
58025792 }
5803- let oparg = u32:: from ( arg) ;
5804- let wrap = oparg == 0 ;
5805- let value = if wrap && self . code . flags . contains ( bytecode:: CodeFlags :: COROUTINE ) {
5806- PyAsyncGenWrappedValue ( value) . into_pyobject ( vm)
5807- } else {
5808- value
5809- } ;
58105793 Ok ( Some ( ExecutionResult :: Yield ( value) ) )
58115794 }
58125795 Instruction :: InstrumentedCall => {
0 commit comments