Skip to content

Commit a173913

Browse files
author
Benjamin Moody
committed
_stream_annotation: use _get_url in place of requests.get.
1 parent b4bd57d commit a173913

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

wfdb/io/download.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,10 @@ def _stream_annotation(file_name, pn_dir):
225225
url = posixpath.join(config.db_index_url, pn_dir, file_name)
226226

227227
# Get the content
228-
response = requests.get(url)
229-
# Raise HTTPError if invalid url
230-
response.raise_for_status()
228+
content = _get_url(url)
231229

232230
# Convert to numpy array
233-
ann_data = np.fromstring(response.content, dtype=np.dtype('<u1'))
231+
ann_data = np.fromstring(content, dtype=np.dtype('<u1'))
234232

235233
return ann_data
236234

0 commit comments

Comments
 (0)