Commit 13b1a5cc authored by Martin v. Löwis's avatar Martin v. Löwis

Don't drop old slots if _unicode_to_string did not change anything.

parent d919a59a
......@@ -1169,8 +1169,10 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
#ifdef Py_USING_UNICODE
tmp = _unicode_to_string(slots, nslots);
Py_DECREF(slots);
slots = tmp;
if (tmp != slots) {
Py_DECREF(slots);
slots = tmp;
}
if (!tmp)
return NULL;
#endif
......
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