]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-152635: Raise MemoryError when the lock allocation fails in `_interpchannel...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 30 Jun 2026 11:22:15 +0000 (13:22 +0200)
committerGitHub <noreply@github.com>
Tue, 30 Jun 2026 11:22:15 +0000 (11:22 +0000)
commit2c9972c697d149390bdf9d54563212a427c5477b
tree907ae9599fad5b5fc843490bb403178e4232770a
parenta4601d078f17b56da589a3008a8ee679209893d1
[3.13] gh-152635: Raise MemoryError when the lock allocation fails in `_interpchannels.create()` (GH-152642) (#152673)

gh-152635: Raise MemoryError when the lock allocation fails in `_interpchannels.create()` (GH-152642)

Previously, an allocation failure when creating
the lock for a channel in `_interpchannels` would trigger an assert.
Caused by `handle_channel_error` being passed an error code of -1
which is only allowed if an exception has been set.
(in this case, no exception was set)

`channelsmod_create` now forwards the error code from `channel_create`
which `handle_channel_error` already handled.
(cherry picked from commit b383aa6e1a8ea53fdeed88c71fbc34d8b2d1fde9)

Co-authored-by: Steve Stagg <stestagg@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
Misc/NEWS.d/next/Core_and_Builtins/2026-06-29-23-29-14.gh-issue-152635.O21J0O.rst [new file with mode: 0644]
Modules/_interpchannelsmodule.c