diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-11-08 23:34:29 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-11-08 23:34:29 (GMT) |
commit | d5af0a5df0621fbac3eb21e444d58a95975cd2ca (patch) | |
tree | 2894af2273b9c6d09d625ff8b4ed155f1923ad0d /Objects/unicodeobject.c | |
parent | 19de4c3a8c6e61a7279537089ac62b5b935889dd (diff) | |
download | cpython-d5af0a5df0621fbac3eb21e444d58a95975cd2ca.zip cpython-d5af0a5df0621fbac3eb21e444d58a95975cd2ca.tar.gz cpython-d5af0a5df0621fbac3eb21e444d58a95975cd2ca.tar.bz2 |
PyUnicode_DecodeFSDefaultAndSize() raises MemoryError if _Py_char2wchar() fails
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |