summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-01-18 07:57:16 (GMT)
committerGuido van Rossum <guido@python.org>1997-01-18 07:57:16 (GMT)
commitc6d0670f1bc77c413892f6089bc20902a59f8f02 (patch)
tree671a6793701a44586241645991324ada32de121b /Objects
parent2a61e7428d5b45fe778b7766bb623d780162f402 (diff)
downloadcpython-c6d0670f1bc77c413892f6089bc20902a59f8f02.zip
cpython-c6d0670f1bc77c413892f6089bc20902a59f8f02.tar.gz
cpython-c6d0670f1bc77c413892f6089bc20902a59f8f02.tar.bz2
Intern the strings created in getattr() and setattr().
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 0af31ba..fc1d086 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -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);