mirror of
https://github.com/python/cpython.git
synced 2025-08-01 23:53:15 +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
|
#ifdef Py_USING_UNICODE
|
||||||
tmp = _unicode_to_string(slots, nslots);
|
tmp = _unicode_to_string(slots, nslots);
|
||||||
Py_DECREF(slots);
|
if (tmp != slots) {
|
||||||
slots = tmp;
|
Py_DECREF(slots);
|
||||||
|
slots = tmp;
|
||||||
|
}
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue