Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set base_url default value inside _request() instead of in signature #204

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion googlemaps/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def __init__(self, key=None, client_id=None, client_secret=None,
self.sent_times = collections.deque("", queries_per_second)

def _request(self, url, params, first_request_time=None, retry_counter=0,
base_url=_DEFAULT_BASE_URL, accepts_clientid=True,
base_url=None, accepts_clientid=True,
extract_body=None, requests_kwargs=None, post_json=None):
"""Performs HTTP GET/POST with credentials, returning the body as
JSON.
Expand Down Expand Up @@ -198,6 +198,9 @@ def _request(self, url, params, first_request_time=None, retry_counter=0,
if not first_request_time:
first_request_time = datetime.now()

if not base_url:
base_url = _DEFAULT_BASE_URL

elapsed = datetime.now() - first_request_time
if elapsed > self.retry_timeout:
raise googlemaps.exceptions.Timeout()
Expand Down