Skip to content

Commit

Permalink
py37 types
Browse files Browse the repository at this point in the history
  • Loading branch information
beliaev-maksim committed Apr 5, 2022
1 parent bb6143d commit 3565faa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions responses/__init__.py
Expand Up @@ -317,13 +317,13 @@ class BaseResponse(object):
def __init__(
self,
method: str,
url: Union[Pattern[str], str],
url: "Union[Pattern[str], str]",
match_querystring: Union[bool, object] = None,
match: "_MatcherIterable" = (),
) -> None:
self.method: str = method
# ensure the url has a default path set if the url is a string
self.url: Union[Pattern[str], str] = _ensure_url_default_path(url)
self.url: "Union[Pattern[str], str]" = _ensure_url_default_path(url)

if self._should_match_querystring(match_querystring):
match = tuple(match) + (_query_string_matcher(urlsplit(self.url).query),)
Expand Down Expand Up @@ -370,7 +370,7 @@ def _should_match_querystring(

return bool(urlsplit(self.url).query)

def _url_matches(self, url: Union[Pattern[str], str], other: str) -> bool:
def _url_matches(self, url: "Union[Pattern[str], str]", other: str) -> bool:
if isinstance(url, str):
if _has_unicode(url):
url = _clean_unicode(url)
Expand Down Expand Up @@ -423,7 +423,7 @@ class Response(BaseResponse):
def __init__(
self,
method: str,
url: Union[Pattern[str], str],
url: "Union[Pattern[str], str]",
body: _Body = "",
json: Optional[Any] = None,
status: int = 200,
Expand Down Expand Up @@ -503,7 +503,7 @@ class CallbackResponse(BaseResponse):
def __init__(
self,
method: str,
url: Union[Pattern[str], str],
url: "Union[Pattern[str], str]",
callback: Callable[[Any], Any],
stream: bool = None,
content_type: Optional[str] = "text/plain",
Expand Down

0 comments on commit 3565faa

Please sign in to comment.