PyUnicode_DecodeFSDefaultAndSize() raises MemoryError if _Py_char2wchar() fails
This commit is contained in:
parent
19de4c3a8c
commit
d5af0a5df0
|
@ -1811,7 +1811,7 @@ PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
|
|||
|
||||
wchar = _Py_char2wchar(s, &len);
|
||||
if (wchar == NULL)
|
||||
return NULL;
|
||||
return PyErr_NoMemory();
|
||||
|
||||
unicode = PyUnicode_FromWideChar(wchar, len);
|
||||
PyMem_Free(wchar);
|
||||
|
|
Loading…
Reference in New Issue