mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Don't drop old slots if _unicode_to_string did not change anything.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user