]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] 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:24:38 +0000 (13:24 +0200)
committerGitHub <noreply@github.com>
Tue, 30 Jun 2026 11:24:38 +0000 (11:24 +0000)
commit589833e0a4fae6b476107f5fb345d8058ce2712a
tree45bb3bb714d6b55a94d1b6a139aabf74b08bf7bc
parenteed97778b9cd738ee1e94dcc0e992fe0a5686f1b
[3.14] gh-152635: Raise MemoryError when the lock allocation fails in `_interpchannels.create()` (GH-152642) (#152672)

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