mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Don't drop old slots if _unicode_to_string did not change anything.
This commit is contained in:
parent
d919a59ab5
commit
13b1a5cc99
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue