]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-104745: Limit starting a patcher more than once without stopping it (#126649)
authorRed4Ru <39802734+Red4Ru@users.noreply.github.com>
Wed, 13 Nov 2024 08:20:38 +0000 (11:20 +0300)
committerGitHub <noreply@github.com>
Wed, 13 Nov 2024 08:20:38 +0000 (08:20 +0000)
commit1e40c5ba47780ddd91868abb3aa064f5ba3015e4
tree1ee9d4458d80c7a853a342f4676ead7de1085994
parent2e39d77ddeb51505d65fd54ccfcd72615c6b1927
gh-104745: Limit starting a patcher more than once without stopping it (#126649)

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

---------

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]