]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] GH-125789: fix `fut._callbacks` to always return a copy of callbacks (#125922...
authorKumar Aditya <kumaraditya@python.org>
Fri, 25 Oct 2024 13:19:31 +0000 (18:49 +0530)
committerGitHub <noreply@github.com>
Fri, 25 Oct 2024 13:19:31 +0000 (13:19 +0000)
commitf54e1a2d6474b4379cab70945fb9e37265bf4159
treea8ecf58244f72a85094b15c5f371123fe8552143
parentb67358125c36c943fb066fdae476c72b34ed57aa
[3.13] GH-125789: fix `fut._callbacks` to always return a copy of callbacks (#125922) (#125976)

GH-125789: fix `fut._callbacks` to always return a copy of callbacks (#125922)

Fix `asyncio.Future._callbacks` to always return a copy of the internal list of callbacks to avoid mutation from user code affecting the internal state.

(cherry picked from commit cae853e3b44cd5cb033b904e163c490dd28bc30a)
Lib/test/test_asyncio/test_futures.py
Misc/NEWS.d/next/Library/2024-10-24-14-08-10.gh-issue-125789.eaiAMw.rst [new file with mode: 0644]
Modules/_asynciomodule.c