]> granicus.if.org Git - python/commitdiff
bpo-29509: skip redundant intern (GH-197)
authorINADA Naoki <methane@users.noreply.github.com>
Tue, 21 Feb 2017 14:57:25 +0000 (23:57 +0900)
committerGitHub <noreply@github.com>
Tue, 21 Feb 2017 14:57:25 +0000 (23:57 +0900)
PyObject_GetAttrString intern temporary key string.
It's completely redudant.

Objects/object.c

index 5da6cffdb98cfeba1cdf91156148017236d6e840..40061b1b3c175d6782fe0c2bf986c2f1a18052b9 100644 (file)
@@ -785,7 +785,7 @@ PyObject_GetAttrString(PyObject *v, const char *name)
 
     if (Py_TYPE(v)->tp_getattr != NULL)
         return (*Py_TYPE(v)->tp_getattr)(v, (char*)name);
-    w = PyUnicode_InternFromString(name);
+    w = PyUnicode_FromString(name);
     if (w == NULL)
         return NULL;
     res = PyObject_GetAttr(v, w);