Download without status updates if server does not report file size. Closes #771.

pull/772/head
Jussi Pakkanen 8 years ago
parent 49583ccfab
commit 3d8876bf59
  1. 8
      mesonbuild/wrap/wrap.py

@ -139,7 +139,13 @@ class Resolver:
else:
resp = urllib.request.urlopen(url)
with contextlib.closing(resp) as resp:
dlsize = int(resp.info()['Content-Length'])
try:
dlsize = int(resp.info()['Content-Length'])
except TypeError:
dlsize = None
if dlsize is None:
print('Downloading file of unknown size.')
return resp.read()
print('Download size:', dlsize)
print('Downloading: ', end='')
sys.stdout.flush()

Loading…
Cancel
Save