resolver: if download files, do not write empty files
@@ -159,10 +159,10 @@ class Resolver(object):
if url.startswith('file://'):
self._copy_or_symlink(url[len('file://'):], outfilename, prefer_symlink)
else:
- with open(outfilename, 'wb') as outfile:
response = requests.get(url)
if response.status_code != 200:
raise Exception("Not found: %s (HTTP %d)" % (url, response.status_code))
+ with open(outfilename, 'wb') as outfile:
outfile.write(response.content)
return outfilename
