Commit 62543ae7 authored by David Glick's avatar David Glick

clean up refcounting around INTERN_INPLACE

parent 7bd85c18
......@@ -559,14 +559,13 @@ pickle___setstate__(PyObject *self, PyObject *state)
while (PyDict_Next(state, &i, &d_key, &d_value)) {
/* normally the keys for instance attributes are
interned. we should try to do that here. */
Py_INCREF(d_key);
if (NATIVE_CHECK_EXACT(d_key))
if (NATIVE_CHECK_EXACT(d_key)) {
Py_INCREF(d_key);
INTERN_INPLACE(&d_key);
if (PyObject_SetItem(*dict, d_key, d_value) < 0) {
Py_DECREF(d_key);
return NULL;
}
Py_DECREF(d_key);
if (PyObject_SetItem(*dict, d_key, d_value) < 0)
return NULL;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment