Skip to content

Commit 3e8d6cb

Browse files
authored
bpo-29509: skip redundant intern (GH-197)
PyObject_GetAttrString intern temporary key string. It's completely redudant.
1 parent 3a9ac82 commit 3e8d6cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ PyObject_GetAttrString(PyObject *v, const char *name)
785785

786786
if (Py_TYPE(v)->tp_getattr != NULL)
787787
return (*Py_TYPE(v)->tp_getattr)(v, (char*)name);
788-
w = PyUnicode_InternFromString(name);
788+
w = PyUnicode_FromString(name);
789789
if (w == NULL)
790790
return NULL;
791791
res = PyObject_GetAttr(v, w);

0 commit comments

Comments
 (0)