From: INADA Naoki Date: Tue, 21 Feb 2017 14:57:25 +0000 (+0900) Subject: bpo-29509: skip redundant intern (GH-197) X-Git-Tag: v3.7.0a1~1306 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3e8d6cb1892377394e4b11819c33fbac728ea9e0;p=python bpo-29509: skip redundant intern (GH-197) PyObject_GetAttrString intern temporary key string. It's completely redudant. --- diff --git a/Objects/object.c b/Objects/object.c index 5da6cffdb9..40061b1b3c 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -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);