File tree 1 file changed +4
-11
lines changed
1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -633,8 +633,6 @@ compiler_unit_free(struct compiler_unit *u)
633
633
static int
634
634
compiler_set_qualname (struct compiler * c )
635
635
{
636
- _Py_static_string (dot , "." );
637
- _Py_static_string (dot_locals , ".<locals>" );
638
636
Py_ssize_t stack_size ;
639
637
struct compiler_unit * u = c -> u ;
640
638
PyObject * name , * base , * dot_str , * dot_locals_str ;
@@ -668,10 +666,9 @@ compiler_set_qualname(struct compiler *c)
668
666
if (!force_global ) {
669
667
if (parent -> u_scope_type == COMPILER_SCOPE_FUNCTION
670
668
|| parent -> u_scope_type == COMPILER_SCOPE_ASYNC_FUNCTION
671
- || parent -> u_scope_type == COMPILER_SCOPE_LAMBDA ) {
672
- dot_locals_str = _PyUnicode_FromId (& dot_locals );
673
- if (dot_locals_str == NULL )
674
- return 0 ;
669
+ || parent -> u_scope_type == COMPILER_SCOPE_LAMBDA )
670
+ {
671
+ dot_locals_str = _Py_GET_GLOBAL_STRING (dot_locals );
675
672
base = PyUnicode_Concat (parent -> u_qualname , dot_locals_str );
676
673
if (base == NULL )
677
674
return 0 ;
@@ -684,11 +681,7 @@ compiler_set_qualname(struct compiler *c)
684
681
}
685
682
686
683
if (base != NULL ) {
687
- dot_str = _PyUnicode_FromId (& dot );
688
- if (dot_str == NULL ) {
689
- Py_DECREF (base );
690
- return 0 ;
691
- }
684
+ dot_str = _Py_GET_GLOBAL_STRING (dot );
692
685
name = PyUnicode_Concat (base , dot_str );
693
686
Py_DECREF (base );
694
687
if (name == NULL )
You can’t perform that action at this time.
0 commit comments