File tree Expand file tree Collapse file tree 2 files changed +377
-15
lines changed Expand file tree Collapse file tree 2 files changed +377
-15
lines changed Original file line number Diff line number Diff 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."""
You can’t perform that action at this time.
0 commit comments