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

This commit is contained in:
Martin v. Löwis 2002-10-14 21:11:34 +00:00
parent d919a59ab5
commit 13b1a5cc99

View file

@ -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