@@ -778,11 +778,8 @@ codegen_leave_annotations_scope(compiler *c, location loc)
778778}
779779
780780static int
781- codegen_deferred_annotations_entry (compiler * c , location loc ,
782- PyObject * conditional_annotation_indices , int scope_type , stmt_ty st , PyObject * mangled , Py_ssize_t i )
781+ codegen_deferred_annotations_entry (compiler * c , location loc , int scope_type , stmt_ty st , PyObject * mangled , PyObject * cond_index )
783782{
784- PyObject * cond_index = PyList_GET_ITEM (conditional_annotation_indices , i );
785- assert (PyLong_CheckExact (cond_index ));
786783 long idx = PyLong_AS_LONG (cond_index );
787784 NEW_JUMP_TARGET_LABEL (c , not_set );
788785
@@ -829,13 +826,16 @@ codegen_deferred_annotations_body(compiler *c, location loc,
829826 if (st == NULL ) {
830827 return ERROR ;
831828 }
829+
830+ PyObject * cond_index = PyList_GET_ITEM (conditional_annotation_indices , i );
831+ assert (PyLong_CheckExact (cond_index ));
832+
832833 PyObject * mangled = _PyCompile_Mangle (c , st -> v .AnnAssign .target -> v .Name .id );
833834 if (!mangled ) {
834835 return ERROR ;
835836 }
836837
837- int ret = codegen_deferred_annotations_entry (c , loc , conditional_annotation_indices ,
838- scope_type , st , mangled , i );
838+ int ret = codegen_deferred_annotations_entry (c , loc , scope_type , st , mangled , cond_index );
839839 Py_DECREF (mangled );
840840 RETURN_IF_ERROR (ret );
841841 }
0 commit comments