From d5af0a5df0621fbac3eb21e444d58a95975cd2ca Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 8 Nov 2010 23:34:29 +0000 Subject: PyUnicode_DecodeFSDefaultAndSize() raises MemoryError if _Py_char2wchar() fails --- Objects/unicodeobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 2250f45..d6cc8b5 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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); -- cgit v0.12