Intern the strings created in getattr() and setattr().

This commit is contained in:
Guido van Rossum 1997-01-18 07:57:16 +00:00
parent 2a61e7428d
commit c6d0670f1b
1 changed files with 2 additions and 2 deletions

View File

@ -335,7 +335,7 @@ getattr(v, name)
{
if (v->ob_type->tp_getattro != NULL) {
object *w, *res;
w = newstringobject(name);
w = PyString_InternFromString(name);
if (w == NULL)
return NULL;
res = (*v->ob_type->tp_getattro)(v, w);
@ -375,7 +375,7 @@ setattr(v, name, w)
if (v->ob_type->tp_setattro != NULL) {
object *s;
int res;
s = newstringobject(name);
s = PyString_InternFromString(name);
if (s == NULL)
return -1;
res = (*v->ob_type->tp_setattro)(v, s, w);