Skip to content

Commit

Permalink
[TRAVELQA-530] - compatibility fix: if timeout is not set - do not se…
Browse files Browse the repository at this point in the history
…nd it to request function.
  • Loading branch information
frdha committed Feb 4, 2020
1 parent 9d34388 commit c4b000d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions reqtools/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ def __init__(self, base_url: str, *, prefix: str = None, request_timeout: int =

self._base_url = base_url
self._prefix = prefix
self._reqest_timeout = 5
if request_timeout:
self._reqest_timeout = request_timeout
self._request_timeout = request_timeout

def __repr__(self):
return f'{self.__class__.__name__}({self.url})'
Expand All @@ -38,7 +37,8 @@ def url(self):
return self._build_url(self._base_url, self._prefix)

def request(self, method: str, url_path: str, **kwargs):
kwargs.setdefault('timeout', self._reqest_timeout)
if self._request_timeout:
kwargs.setdefault('timeout', self._request_timeout)

url = self._build_url(self.url, url_path)

Expand Down

0 comments on commit c4b000d

Please sign in to comment.