@@ -667,6 +667,7 @@ compiler_set_qualname(struct compiler *c)
667
667
|| parent -> u_scope_type == COMPILER_SCOPE_ASYNC_FUNCTION
668
668
|| parent -> u_scope_type == COMPILER_SCOPE_LAMBDA )
669
669
{
670
+ _Py_DECLARE_STR (dot_locals , ".<locals>" );
670
671
base = PyUnicode_Concat (parent -> u_qualname ,
671
672
& _Py_STR (dot_locals ));
672
673
if (base == NULL )
@@ -2022,6 +2023,7 @@ compiler_mod(struct compiler *c, mod_ty mod)
2022
2023
{
2023
2024
PyCodeObject * co ;
2024
2025
int addNone = 1 ;
2026
+ _Py_DECLARE_STR (anon_module , "<module>" );
2025
2027
if (!compiler_enter_scope (c , & _Py_STR (anon_module ), COMPILER_SCOPE_MODULE ,
2026
2028
mod , 1 )) {
2027
2029
return NULL ;
@@ -2876,6 +2878,7 @@ compiler_lambda(struct compiler *c, expr_ty e)
2876
2878
return 0 ;
2877
2879
}
2878
2880
2881
+ _Py_DECLARE_STR (anon_lambda , "<lambda>" );
2879
2882
if (!compiler_enter_scope (c , & _Py_STR (anon_lambda ), COMPILER_SCOPE_LAMBDA ,
2880
2883
(void * )e , e -> lineno )) {
2881
2884
return 0 ;
@@ -5347,6 +5350,7 @@ static int
5347
5350
compiler_genexp (struct compiler * c , expr_ty e )
5348
5351
{
5349
5352
assert (e -> kind == GeneratorExp_kind );
5353
+ _Py_DECLARE_STR (anon_genexpr , "<genexpr>" );
5350
5354
return compiler_comprehension (c , e , COMP_GENEXP , & _Py_STR (anon_genexpr ),
5351
5355
e -> v .GeneratorExp .generators ,
5352
5356
e -> v .GeneratorExp .elt , NULL );
@@ -5356,6 +5360,7 @@ static int
5356
5360
compiler_listcomp (struct compiler * c , expr_ty e )
5357
5361
{
5358
5362
assert (e -> kind == ListComp_kind );
5363
+ _Py_DECLARE_STR (anon_listcomp , "<listcomp>" );
5359
5364
return compiler_comprehension (c , e , COMP_LISTCOMP , & _Py_STR (anon_listcomp ),
5360
5365
e -> v .ListComp .generators ,
5361
5366
e -> v .ListComp .elt , NULL );
@@ -5365,6 +5370,7 @@ static int
5365
5370
compiler_setcomp (struct compiler * c , expr_ty e )
5366
5371
{
5367
5372
assert (e -> kind == SetComp_kind );
5373
+ _Py_DECLARE_STR (anon_setcomp , "<setcomp>" );
5368
5374
return compiler_comprehension (c , e , COMP_SETCOMP , & _Py_STR (anon_setcomp ),
5369
5375
e -> v .SetComp .generators ,
5370
5376
e -> v .SetComp .elt , NULL );
@@ -5375,6 +5381,7 @@ static int
5375
5381
compiler_dictcomp (struct compiler * c , expr_ty e )
5376
5382
{
5377
5383
assert (e -> kind == DictComp_kind );
5384
+ _Py_DECLARE_STR (anon_dictcomp , "<dictcomp>" );
5378
5385
return compiler_comprehension (c , e , COMP_DICTCOMP , & _Py_STR (anon_dictcomp ),
5379
5386
e -> v .DictComp .generators ,
5380
5387
e -> v .DictComp .key , e -> v .DictComp .value );
0 commit comments