Skip to content

Commit

Permalink
fix #556
Browse files Browse the repository at this point in the history
mypy patcher complaints on namespace packages
  • Loading branch information
beliaev-maksim committed Jun 22, 2022
1 parent b129335 commit 97c7b27
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions responses/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@

if TYPE_CHECKING: # pragma: no cover
# import only for linter run
from mypy.typeshed.stdlib.unittest.mock import _patcher as _mock_patcher
from unittest.mock import _patch as _mock_patcher

from requests import PreparedRequest
from requests import models
from urllib3 import Retry as _Retry
Expand Down Expand Up @@ -652,7 +653,7 @@ def __init__(
self.response_callback: Optional[Callable[[Any], Response]] = response_callback
self.passthru_prefixes: Tuple[_URLPatternType, ...] = tuple(passthru_prefixes)
self.target: str = target
self._patcher: Optional["_mock_patcher"] = None
self._patcher: Optional["_mock_patcher[Any]"] = None
self._thread_lock = _ThreadingLock()

def get_registry(self) -> FirstMatchRegistry:
Expand Down

0 comments on commit 97c7b27

Please sign in to comment.