2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-30 21:07:40 +00:00

Rewrite download loop

The sentinal value would not get hit with
python3 ('' versus b'').  Change to use
an easier to use while loop.

Change-Id: I4d7f4b763aff1fdf13e5a53377146606de199a11
This commit is contained in:
Jarrod Johnson 2020-03-10 14:23:40 -04:00
parent 32f2e2827f
commit 4d0ee6238e

View File

@ -247,8 +247,10 @@ class SecureHTTPConnection(httplib.HTTPConnection, object):
rsp = webclient.getresponse()
self._currdl = rsp
self._dlfile = file
for chunk in iter(lambda: rsp.read(16384), ''):
chunk = rsp.read(16384)
while chunk:
file.write(chunk)
chunk = rsp.read(16384)
self._currdl = None
file.close()