We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
newblock
1 parent 1b4135a commit a90576dCopy full SHA for a90576d
2 files changed
Misc/NEWS.d/next/Library/2026-07-03-14-54-33.gh-issue-152951.u8tPCI.rst
@@ -0,0 +1,2 @@
1
+:class:`collections.deque` prevent rare crash when calling ``extend`` under
2
+high memory pressure conditions.
Modules/_collectionsmodule.c
@@ -512,7 +512,6 @@ deque_extend_impl(dequeobject *deque, PyObject *iterable)
512
iternext = *Py_TYPE(it)->tp_iternext;
513
while ((item = iternext(it)) != NULL) {
514
if (deque_append_lock_held(deque, item, maxlen) == -1) {
515
- Py_DECREF(item);
516
Py_DECREF(it);
517
return NULL;
518
}
0 commit comments