]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-104745: Limit starting a patcher more than once without stopping it (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 13 Nov 2024 08:37:34 +0000 (09:37 +0100)
committerGitHub <noreply@github.com>
Wed, 13 Nov 2024 08:37:34 +0000 (08:37 +0000)
commit951ed3305489ef2180972c9786de0ff61042128b
tree6c06055eed5a22276718ff9b55d27a73bc1a9142
parent361dda59a3a73e4bd2b6498d16dcc22195670d1d
[3.12] gh-104745: Limit starting a patcher more than once without stopping it (GH-126649) (#126773)

gh-104745: Limit starting a patcher more than once without stopping it (GH-126649)

Previously, this would cause an `AttributeError` if the patch stopped more than once after this, and would also disrupt the original patched object.

---------

(cherry picked from commit 1e40c5ba47780ddd91868abb3aa064f5ba3015e4)

Co-authored-by: Red4Ru <39802734+Red4Ru@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Lib/test/test_unittest/testmock/testpatch.py
Lib/unittest/mock.py
Misc/NEWS.d/next/Library/2024-11-10-18-14-51.gh-issue-104745.zAa5Ke.rst [new file with mode: 0644]