diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 9052c53f11b8e2..2261b9a0316259 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -677,10 +677,12 @@ unicode_result_ready(PyObject *unicode) if (kind == PyUnicode_1BYTE_KIND) { const Py_UCS1 *data = PyUnicode_1BYTE_DATA(unicode); Py_UCS1 ch = data[0]; - if (unicode != LATIN1(ch)) { + PyObject *latin1_char = LATIN1(ch); + if (unicode != latin1_char) { + Py_INCREF(latin1_char); Py_DECREF(unicode); } - return get_latin1_char(ch); + return latin1_char; } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy