]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-125789: fix `fut._callbacks` to always return a copy of callbacks (#125922)
authorKumar Aditya <kumaraditya@python.org>
Fri, 25 Oct 2024 12:49:30 +0000 (18:19 +0530)
committerGitHub <noreply@github.com>
Fri, 25 Oct 2024 12:49:30 +0000 (18:19 +0530)
commitcae853e3b44cd5cb033b904e163c490dd28bc30a
tree31d8533074f271cf1d4710552171c8b54e62512c
parentebcc578dff47b1dcffb634923bedc5361c8f29f6
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.
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