]> granicus.if.org Git - python/commitdiff
Try to fix the problem on the Windows buildbot where this code:
authorNeal Norwitz <nnorwitz@gmail.com>
Thu, 30 Aug 2007 05:44:54 +0000 (05:44 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Thu, 30 Aug 2007 05:44:54 +0000 (05:44 +0000)
  b * sys.maxint  # from test_bytes.py line 379

Caused:  SystemError: error return without exception set

Objects/bytesobject.c

index c13269262f4ba19dea535f0594d4f8bab00ba8a3..ec379281ccce8487278427b3056c277098938d06 100644 (file)
@@ -125,7 +125,7 @@ PyBytes_FromStringAndSize(const char *bytes, Py_ssize_t size)
         new->ob_bytes = PyMem_Malloc(alloc);
         if (new->ob_bytes == NULL) {
             Py_DECREF(new);
-            return NULL;
+            return PyErr_NoMemory();
         }
         if (bytes != NULL)
             memcpy(new->ob_bytes, bytes, size);