]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-61215: threadingmock: Remove unused branch for `timeout` (#106591)
authorMario Corchero <mcorcherojim@bloomberg.net>
Mon, 10 Jul 2023 13:35:54 +0000 (15:35 +0200)
committerGitHub <noreply@github.com>
Mon, 10 Jul 2023 13:35:54 +0000 (07:35 -0600)
threadingmock: Remove unused branch for `timeout`

This is no longer needed as the mock does not hold a "timeout"
parameter, the timeout is stored in `_mock_wait_timeout`.

Lib/unittest/mock.py

index 7ef7e7180b31c255c14c6028fd87228d57cac5fa..3ed54b3ba230ed4a2987b8ee424ccee12f8d7823 100644 (file)
@@ -3012,9 +3012,7 @@ class ThreadingMixin(Base):
     DEFAULT_TIMEOUT = None
 
     def _get_child_mock(self, /, **kw):
-        if "timeout" in kw:
-            kw["timeout"] = kw.pop("timeout")
-        elif isinstance(kw.get("parent"), ThreadingMixin):
+        if isinstance(kw.get("parent"), ThreadingMixin):
             kw["timeout"] = kw["parent"]._mock_wait_timeout
         elif isinstance(kw.get("_new_parent"), ThreadingMixin):
             kw["timeout"] = kw["_new_parent"]._mock_wait_timeout