bpo-29509: skip redundant intern (GH-197)

PyObject_GetAttrString intern temporary key string.
It's completely redudant.
This commit is contained in:
INADA Naoki 2017-02-21 23:57:25 +09:00 committed by GitHub
parent 3a9ac827c7
commit 3e8d6cb189

View 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);