summaryrefslogtreecommitdiffstats
path: root/Objects/bytesobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r--Objects/bytesobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index c132692..ec37928 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -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);