]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.8] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH...
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 12 Apr 2020 11:53:46 +0000 (14:53 +0300)
committerGitHub <noreply@github.com>
Sun, 12 Apr 2020 11:53:46 +0000 (14:53 +0300)
commitee249d798ba08f065efbf4f450880a446c6ca49d
tree67a2ddffe43877e3345bf6cb638008aa3e667a98
parent2714c907df7cfe97911df6ce90364001270d9a43
[3.8] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH-19483)

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]