Thanks to visit codestin.com Credit goes to github.com
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 225b055 commit 74a307dCopy full SHA for 74a307d
1 file changed
Objects/unicodeobject.c
@@ -6813,8 +6813,6 @@ unicode_encode_ucs1(PyObject *unicode,
6813
str = _PyBytesWriter_WriteBytes(&writer, str,
6814
PyBytes_AS_STRING(rep),
6815
PyBytes_GET_SIZE(rep));
6816
- if (str == NULL)
6817
- goto onError;
6818
}
6819
else {
6820
assert(PyUnicode_Check(rep));
@@ -6836,6 +6834,9 @@ unicode_encode_ucs1(PyObject *unicode,
6836
6834
PyUnicode_DATA(rep),
6837
6835
PyUnicode_GET_LENGTH(rep));
6838
+ if (str == NULL)
+ goto onError;
6839
+
6840
pos = newpos;
6841
Py_CLEAR(rep);
6842
0 commit comments