Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions malariagen_data/anoph/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,16 @@ def __init__(
if check_location:
try:
self._client_details = ipinfo.getHandler().getDetails()
except OSError:
pass
except OSError as exc:
self._log.debug(f"Location check failed: {exc}")
warnings.warn(
"Could not determine client location via ipinfo.io "
f"({exc}). Region-optimal GCS bucket selection is "
Comment on lines +106 to +110
"unavailable. You can manually specify a region using "
"the `url` parameter.",
Comment on lines +111 to +112
UserWarning,
stacklevel=2,
)

# Determine cloud location details.
self._gcp_region = _get_gcp_region(self._client_details)
Expand Down
Loading