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 0e1e8db commit 1e596d3Copy full SHA for 1e596d3
Objects/unicodeobject.c
@@ -6812,8 +6812,6 @@ unicode_encode_ucs1(PyObject *unicode,
6812
str = _PyBytesWriter_WriteBytes(&writer, str,
6813
PyBytes_AS_STRING(rep),
6814
PyBytes_GET_SIZE(rep));
6815
- if (str == NULL)
6816
- goto onError;
6817
}
6818
else {
6819
assert(PyUnicode_Check(rep));
@@ -6835,6 +6833,9 @@ unicode_encode_ucs1(PyObject *unicode,
6835
6833
PyUnicode_DATA(rep),
6836
6834
PyUnicode_GET_LENGTH(rep));
6837
+ if (str == NULL)
+ goto onError;
6838
+
6839
pos = newpos;
6840
Py_CLEAR(rep);
6841
0 commit comments