From: Alejandro Cabello Jiménez <33024690+acabelloj@users.noreply.github.com> Date: Wed, 12 Nov 2025 00:36:43 +0000 (+0100) Subject: gh-137928: remove redundant size validation in multiprocessing.heap (GH-137929) X-Git-Tag: v3.15.0a2~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df6676549cd67c7b83111c6fce7c546270604aa6;p=thirdparty%2FPython%2Fcpython.git gh-137928: remove redundant size validation in multiprocessing.heap (GH-137929) remove redundant size check, malloc does it --------- Co-authored-by: Gregory P. Smith --- 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,))