bpo-33270: Intern names for all anonymous code objects (#6472)

This commit is contained in:
Zackery Spytz 2018-04-15 16:12:29 -06:00 committed by Serhiy Storchaka
parent afbbac12a5
commit f303639e3a
4 changed files with 9 additions and 8 deletions

View file

@ -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;
}