Skip to content

Commit 634e3b4

Browse files
committed
minor tweaks
1 parent 2f1537f commit 634e3b4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

wolframclient/serializers/wxfencoder/streaming.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ def _read_rest(self, data, size=-1):
5555
out_len = len(data)
5656
while out_len < size:
5757
chunk = self._reader.read(size - out_len)
58-
if chunk == b"":
58+
if not chunk:
5959
raise EOFError("Not enough data to read.")
6060
yield chunk
61-
out_len = out_len + len(chunk)
61+
out_len += len(chunk)
6262

6363
class ZipCompressedReader(object):
6464
"""A buffer implementation reading zip compressed data from a source buffer and returning uncompressed data.
@@ -90,22 +90,22 @@ def read(self, size=-1):
9090
while True:
9191
# first step find try to find some data to uncompress.
9292
# sometimes some bytes are left over. We have to send them first to zlib.
93-
if self._compressor.unconsumed_tail != b"":
93+
if self._compressor.unconsumed_tail:
9494
data_in = self._compressor.unconsumed_tail
9595
else:
9696
# read more data from input reader. Read in chunk since we can't guess how
9797
# big the inflated result is.
9898
data_in = self._reader.read(chunk_size)
9999
# no more data is available.
100-
if data_in == b"":
100+
if not data_in:
101101
break
102102
# second step, decompress the new chunk
103103
if size > 0:
104104
chunk = self._compressor.decompress(data_in, size - out_len)
105105
else:
106106
chunk = self._compressor.decompress(data_in)
107107
# increment output len.
108-
out_len = out_len + len(chunk)
108+
out_len += len(chunk)
109109
# write to buffer
110110
yield chunk
111111
# check requested size against output length.

0 commit comments

Comments
 (0)