]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] GH-125789: fix `fut._callbacks` to always return a copy of callbacks (GH-12592...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 25 Oct 2024 14:02:46 +0000 (16:02 +0200)
committerGitHub <noreply@github.com>
Fri, 25 Oct 2024 14:02:46 +0000 (19:32 +0530)
commit42927f7f2588b32c1033292d673405a94eb36f77
tree7e06511641725aa5397589e4e931c7216f1805d5
parent31ff9e5ac685dff58456f7fa93d1872e8cda604f
[3.12] GH-125789: fix `fut._callbacks` to always return a copy of callbacks (GH-125922) (#125977)

GH-125789: fix `fut._callbacks` to always return a copy of callbacks (GH-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.

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
(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