Skip to content

Commit 4b99c09

Browse files
authored
Merge pull request #504 from sjsrey/remotes
Remove automatic polling of remotes
2 parents d291e01 + 2c3b43d commit 4b99c09

File tree

2 files changed

+377
-15
lines changed

2 files changed

+377
-15
lines changed

libpysal/examples/base.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,17 @@ def download(self, path=get_data_home()):
175175
"""Download the files for the example."""
176176

177177
if not self.downloaded():
178-
request = requests.get(self.download_url)
179-
archive = zipfile.ZipFile(io.BytesIO(request.content))
180-
target = os.path.join(path, self.root)
181-
print("Downloading {} to {}".format(self.name, target))
182-
archive.extractall(path=target)
183-
self.zipfile = archive
184-
self.installed = True
178+
try:
179+
request = requests.get(self.download_url)
180+
archive = zipfile.ZipFile(io.BytesIO(request.content))
181+
target = os.path.join(path, self.root)
182+
print("Downloading {} to {}".format(self.name, target))
183+
archive.extractall(path=target)
184+
self.zipfile = archive
185+
self.installed = True
186+
except requests.exceptions.RequestException as e:
187+
raise SystemExit(e)
188+
185189

186190
def get_file_list(self) -> Union[list, None]:
187191
"""Get the list of local files for the example."""

0 commit comments

Comments
 (0)