[Python-checkins] r86344 - python/branches/py3k/Objects/unicodeobject.c

victor.stinner python-checkins at python.org
Tue Nov 9 00:34:29 CET 2010


Author: victor.stinner
Date: Tue Nov  9 00:34:29 2010
New Revision: 86344

Log:
PyUnicode_DecodeFSDefaultAndSize() raises MemoryError if _Py_char2wchar() fails


Modified:
   python/branches/py3k/Objects/unicodeobject.c

Modified: python/branches/py3k/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k/Objects/unicodeobject.c	(original)
+++ python/branches/py3k/Objects/unicodeobject.c	Tue Nov  9 00:34:29 2010
@@ -1811,7 +1811,7 @@
 
         wchar = _Py_char2wchar(s, &len);
         if (wchar == NULL)
-            return NULL;
+            return PyErr_NoMemory();
 
         unicode = PyUnicode_FromWideChar(wchar, len);
         PyMem_Free(wchar);


More information about the Python-checkins mailing list