Skip to content

Commit b4bd57d

Browse files
author
Benjamin Moody
committed
_stream_header: use _get_url in place of requests.get.
1 parent 2004a83 commit b4bd57d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

wfdb/io/download.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,12 @@ def _stream_header(file_name, pn_dir):
131131
"""
132132
# Full url of header location
133133
url = posixpath.join(config.db_index_url, pn_dir, file_name)
134-
response = requests.get(url)
135134

136-
# Raise HTTPError if invalid url
137-
response.raise_for_status()
135+
# Get the content of the remote file
136+
content = _get_url(url)
138137

139138
# Get each line as a string
140-
filelines = response.content.decode('iso-8859-1').splitlines()
139+
filelines = content.decode('iso-8859-1').splitlines()
141140

142141
# Separate content into header and comment lines
143142
header_lines = []

0 commit comments

Comments
 (0)