@@ -707,16 +707,8 @@ codegen_enter_scope(compiler *c, identifier name, int scope_type,
707707}
708708
709709static int
710- codegen_setup_annotations_scope (compiler * c , location loc ,
711- void * key , PyObject * name )
710+ codegen_emit_annotations_prologue (compiler * c , location loc )
712711{
713- _PyCompile_CodeUnitMetadata umd = {
714- .u_posonlyargcount = 1 ,
715- };
716- RETURN_IF_ERROR (
717- codegen_enter_scope (c , name , COMPILE_SCOPE_ANNOTATIONS ,
718- key , loc .lineno , NULL , & umd ));
719-
720712 // if .format > VALUE_WITH_FAKE_GLOBALS: raise NotImplementedError
721713 PyObject * value_with_fake_globals = PyLong_FromLong (_Py_ANNOTATE_FORMAT_VALUE_WITH_FAKE_GLOBALS );
722714 if (value_with_fake_globals == NULL ) {
@@ -736,6 +728,21 @@ codegen_setup_annotations_scope(compiler *c, location loc,
736728 return SUCCESS ;
737729}
738730
731+ static int
732+ codegen_setup_annotations_scope (compiler * c , location loc ,
733+ void * key , PyObject * name )
734+ {
735+ _PyCompile_CodeUnitMetadata umd = {
736+ .u_posonlyargcount = 1 ,
737+ };
738+ RETURN_IF_ERROR (
739+ codegen_enter_scope (c , name , COMPILE_SCOPE_ANNOTATIONS ,
740+ key , loc .lineno , NULL , & umd ));
741+
742+ RETURN_IF_ERROR_IN_SCOPE (c , codegen_emit_annotations_prologue (c , loc ));
743+ return SUCCESS ;
744+ }
745+
739746static int
740747codegen_rename_annotations_format_param (PyCodeObject * co )
741748{
0 commit comments