We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6a5d85 commit 54ab9adCopy full SHA for 54ab9ad
1 file changed
Objects/unicodeobject.c
@@ -677,10 +677,12 @@ unicode_result_ready(PyObject *unicode)
677
if (kind == PyUnicode_1BYTE_KIND) {
678
const Py_UCS1 *data = PyUnicode_1BYTE_DATA(unicode);
679
Py_UCS1 ch = data[0];
680
- if (unicode != LATIN1(ch)) {
+ PyObject *latin1_char = LATIN1(ch);
681
+ if (unicode != latin1_char) {
682
+ Py_INCREF(latin1_char);
683
Py_DECREF(unicode);
684
}
- return get_latin1_char(ch);
685
+ return latin1_char;
686
687
688
0 commit comments