From df6676549cd67c7b83111c6fce7c546270604aa6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alejandro=20Cabello=20Jim=C3=A9nez?= <33024690+acabelloj@users.noreply.github.com> Date: Wed, 12 Nov 2025 01:36:43 +0100 Subject: [PATCH] gh-137928: remove redundant size validation in multiprocessing.heap (GH-137929) remove redundant size check, malloc does it --------- Co-authored-by: Gregory P. Smith --- Lib/multiprocessing/heap.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Lib/multiprocessing/heap.py b/Lib/multiprocessing/heap.py index 6217dfe12689..5c835648395f 100644 --- a/Lib/multiprocessing/heap.py +++ b/Lib/multiprocessing/heap.py @@ -324,10 +324,6 @@ class BufferWrapper(object): _heap = Heap() def __init__(self, size): - if size < 0: - raise ValueError("Size {0:n} out of range".format(size)) - if sys.maxsize <= size: - raise OverflowError("Size {0:n} too large".format(size)) block = BufferWrapper._heap.malloc(size) self._state = (block, size) util.Finalize(self, BufferWrapper._heap.free, args=(block,)) -- 2.47.3