Fix gzip wrap to keep reading from the buffer once the inner loop has completed
This commit is contained in:
parent
e4d9bacccb
commit
ee99e68a67
1 changed files with 1 additions and 4 deletions
|
@ -11,12 +11,9 @@ class GzipWrap(object):
|
||||||
self.is_done = False
|
self.is_done = False
|
||||||
|
|
||||||
def read(self, size=-1):
|
def read(self, size=-1):
|
||||||
if self.is_done:
|
|
||||||
return ''
|
|
||||||
|
|
||||||
# If the buffer already has enough bytes, then simply pop them off of
|
# If the buffer already has enough bytes, then simply pop them off of
|
||||||
# the beginning and return them.
|
# the beginning and return them.
|
||||||
if len(self.buffer) >= size:
|
if len(self.buffer) >= size or self.is_done:
|
||||||
ret = self.buffer[0:size]
|
ret = self.buffer[0:size]
|
||||||
self.buffer = self.buffer[size:]
|
self.buffer = self.buffer[size:]
|
||||||
return ret
|
return ret
|
||||||
|
|
Reference in a new issue