]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] 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:46:12 +0000 (09:46 +0100)
committerGitHub <noreply@github.com>
Wed, 13 Nov 2024 08:46:12 +0000 (08:46 +0000)
commite8dbe7ec573c50d082d4b7a32fe54ead0937557a
tree9eac343c42b1a30429bd334cb483aba9114ff71d
parentb03ba54efc6509a59fd6971f9769c0d9dced1db6
[3.13] gh-104745: Limit starting a patcher more than once without stopping it (GH-126649) (#126772)

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]