Skip to content

Commit 5f7e8da

Browse files
committed
Issue #16592: stringlib_bytes_join doesn't raise MemoryError on allocation failure
1 parent 17ad40e commit 5f7e8da

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 1?
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #16592: stringlib_bytes_join doesn't raise MemoryError on allocation
14+
failure.
15+
1316
- Issue #16546: Fix: ast.YieldFrom argument is now mandatory.
1417

1518
- Issue #16514: Fix regression causing a traceback when sys.path[0] is None

Objects/stringlib/join.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ STRINGLIB(bytes_join)(PyObject *sep, PyObject *iterable)
4343
buffers = PyMem_NEW(Py_buffer, seqlen);
4444
if (buffers == NULL) {
4545
Py_DECREF(seq);
46+
PyErr_NoMemory();
4647
return NULL;
4748
}
4849
}

0 commit comments

Comments
 (0)