Skip to content

Commit

Permalink
get_buffers: check for length is None, not falsiness
Browse files Browse the repository at this point in the history
Fixes #71.
  • Loading branch information
mistydemeo committed May 16, 2016
1 parent 4a2e640 commit 4bfb71d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fido/fido.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,10 +525,10 @@ def get_buffers(self, stream, length=None, seekable=False):
If length is None, return the length as found.
If seekable is False, the steam does not support a seek operation.
"""
bytes_to_read = self.bufsize if not length else min(length, self.bufsize)
bytes_to_read = self.bufsize if length is None else min(length, self.bufsize)
bofbuffer = self.blocking_read(stream, bytes_to_read)
bytes_read = len(bofbuffer)
if not length:
if length is None:
# A stream with unknown length; have to keep two buffers around
prevbuffer = bofbuffer
while True:
Expand Down

0 comments on commit 4bfb71d

Please sign in to comment.