]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.7] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH...
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 12 Apr 2020 11:54:03 +0000 (14:54 +0300)
committerGitHub <noreply@github.com>
Sun, 12 Apr 2020 11:54:03 +0000 (14:54 +0300)
commit4057e8f9b56789223a1e691d7601003aceb84ad1
tree674f6c331af2f506a8bcbbcea3c30809867895d8
parent2e49b5254aa0888dd21a7929be14b6cfe03d56ef
[3.7] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH-19484)

Patcher's __exit__() is now never called if its __enter__() is failed.
Returning true from __exit__() silences now the exception.
(cherry picked from commit 4b222c9491d1700e9bdd98e6889b8d0ea1c7321e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/unittest/mock.py
Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst [new file with mode: 0644]