@@ -667,6 +667,7 @@ compiler_set_qualname(struct compiler *c)
667667 || parent -> u_scope_type == COMPILER_SCOPE_ASYNC_FUNCTION
668668 || parent -> u_scope_type == COMPILER_SCOPE_LAMBDA )
669669 {
670+ _Py_DECLARE_STR (dot_locals , ".<locals>" );
670671 base = PyUnicode_Concat (parent -> u_qualname ,
671672 & _Py_STR (dot_locals ));
672673 if (base == NULL )
@@ -2022,6 +2023,7 @@ compiler_mod(struct compiler *c, mod_ty mod)
20222023{
20232024 PyCodeObject * co ;
20242025 int addNone = 1 ;
2026+ _Py_DECLARE_STR (anon_module , "<module>" );
20252027 if (!compiler_enter_scope (c , & _Py_STR (anon_module ), COMPILER_SCOPE_MODULE ,
20262028 mod , 1 )) {
20272029 return NULL ;
@@ -2876,6 +2878,7 @@ compiler_lambda(struct compiler *c, expr_ty e)
28762878 return 0 ;
28772879 }
28782880
2881+ _Py_DECLARE_STR (anon_lambda , "<lambda>" );
28792882 if (!compiler_enter_scope (c , & _Py_STR (anon_lambda ), COMPILER_SCOPE_LAMBDA ,
28802883 (void * )e , e -> lineno )) {
28812884 return 0 ;
@@ -5347,6 +5350,7 @@ static int
53475350compiler_genexp (struct compiler * c , expr_ty e )
53485351{
53495352 assert (e -> kind == GeneratorExp_kind );
5353+ _Py_DECLARE_STR (anon_genexpr , "<genexpr>" );
53505354 return compiler_comprehension (c , e , COMP_GENEXP , & _Py_STR (anon_genexpr ),
53515355 e -> v .GeneratorExp .generators ,
53525356 e -> v .GeneratorExp .elt , NULL );
@@ -5356,6 +5360,7 @@ static int
53565360compiler_listcomp (struct compiler * c , expr_ty e )
53575361{
53585362 assert (e -> kind == ListComp_kind );
5363+ _Py_DECLARE_STR (anon_listcomp , "<listcomp>" );
53595364 return compiler_comprehension (c , e , COMP_LISTCOMP , & _Py_STR (anon_listcomp ),
53605365 e -> v .ListComp .generators ,
53615366 e -> v .ListComp .elt , NULL );
@@ -5365,6 +5370,7 @@ static int
53655370compiler_setcomp (struct compiler * c , expr_ty e )
53665371{
53675372 assert (e -> kind == SetComp_kind );
5373+ _Py_DECLARE_STR (anon_setcomp , "<setcomp>" );
53685374 return compiler_comprehension (c , e , COMP_SETCOMP , & _Py_STR (anon_setcomp ),
53695375 e -> v .SetComp .generators ,
53705376 e -> v .SetComp .elt , NULL );
@@ -5375,6 +5381,7 @@ static int
53755381compiler_dictcomp (struct compiler * c , expr_ty e )
53765382{
53775383 assert (e -> kind == DictComp_kind );
5384+ _Py_DECLARE_STR (anon_dictcomp , "<dictcomp>" );
53785385 return compiler_comprehension (c , e , COMP_DICTCOMP , & _Py_STR (anon_dictcomp ),
53795386 e -> v .DictComp .generators ,
53805387 e -> v .DictComp .key , e -> v .DictComp .value );
0 commit comments