Skip to content

Commit a95497a

Browse files
committed
getheader python 3
1 parent 5f76f57 commit a95497a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

browserstack/local_binary.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ def __available_dir(self):
4747

4848
def download(self, chunk_size=8192, progress_hook=None):
4949
response = urlopen(self.http_path)
50-
total_size = int(response.info().get_all('Content-Length').strip())
50+
try:
51+
total_size = int(response.info().getheader('Content-Length').strip())
52+
except:
53+
total_size = int(response.info().get_all('Content-Length')[0].strip())
5154
bytes_so_far = 0
5255

5356
dest_parent_dir = self.__available_dir()

0 commit comments

Comments
 (0)