mirror of
https://github.com/python/cpython.git
synced 2025-10-21 06:02:21 +00:00
bpo-33270: Intern names for all anonymous code objects (#6472)
This commit is contained in:
parent
afbbac12a5
commit
f303639e3a
4 changed files with 9 additions and 8 deletions
|
@ -4145,7 +4145,7 @@ compiler_genexp(struct compiler *c, expr_ty e)
|
|||
{
|
||||
static identifier name;
|
||||
if (!name) {
|
||||
name = PyUnicode_FromString("<genexpr>");
|
||||
name = PyUnicode_InternFromString("<genexpr>");
|
||||
if (!name)
|
||||
return 0;
|
||||
}
|
||||
|
@ -4160,7 +4160,7 @@ compiler_listcomp(struct compiler *c, expr_ty e)
|
|||
{
|
||||
static identifier name;
|
||||
if (!name) {
|
||||
name = PyUnicode_FromString("<listcomp>");
|
||||
name = PyUnicode_InternFromString("<listcomp>");
|
||||
if (!name)
|
||||
return 0;
|
||||
}
|
||||
|
@ -4175,7 +4175,7 @@ compiler_setcomp(struct compiler *c, expr_ty e)
|
|||
{
|
||||
static identifier name;
|
||||
if (!name) {
|
||||
name = PyUnicode_FromString("<setcomp>");
|
||||
name = PyUnicode_InternFromString("<setcomp>");
|
||||
if (!name)
|
||||
return 0;
|
||||
}
|
||||
|
@ -4191,7 +4191,7 @@ compiler_dictcomp(struct compiler *c, expr_ty e)
|
|||
{
|
||||
static identifier name;
|
||||
if (!name) {
|
||||
name = PyUnicode_FromString("<dictcomp>");
|
||||
name = PyUnicode_InternFromString("<dictcomp>");
|
||||
if (!name)
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue