]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-112182: Replace StopIteration with RuntimeError for future (#113220)
authorJamie Phan <jamie@ordinarylab.dev>
Wed, 10 Jan 2024 05:21:00 +0000 (16:21 +1100)
committerGitHub <noreply@github.com>
Wed, 10 Jan 2024 05:21:00 +0000 (21:21 -0800)
commit4826d52338396758b2d6790a498c2a06eec19a86
treee1dc94c361fbc8ffb62d108bc8587b7072cd522a
parent5d8a3e74b51a59752f24cb869e7daa065b673f83
gh-112182: Replace StopIteration with RuntimeError for future (#113220)

When an `StopIteration` raises into `asyncio.Future`, this will cause
a thread to hang. This commit address this by not raising an exception
and silently transforming the `StopIteration` with a `RuntimeError`,
which the caller can reconstruct from `fut.exception().__cause__`
Lib/asyncio/futures.py
Lib/test/test_asyncio/test_futures.py
Misc/NEWS.d/next/Library/2023-12-17-10-22-55.gh-issue-112182.jLWGlr.rst [new file with mode: 0644]
Modules/_asynciomodule.c