summaryrefslogtreecommitdiff
path: root/Lib/unittest/mock.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest/mock.py')
-rw-r--r--Lib/unittest/mock.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index fdde16be03..8684f1dfa5 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -1398,7 +1398,7 @@ class _patch(object):
def __exit__(self, *exc_info):
"""Undo the patch."""
if not _is_started(self):
- raise RuntimeError('stop called on unstarted patcher')
+ return
if self.is_local and self.temp_original is not DEFAULT:
setattr(self.target, self.attribute, self.temp_original)