def readexactly(self, n):
"""COUROUTINE: Read exactly n bytes, or until EOF."""
blocks = []
count = 0
while n > count:
block = yield from self.read(n - count)
+ if not block:
+ break
blocks.append(block)
count += len(block)
return b''.join(blocks)
Original issue reported on code.google.com by shibt...@gmail.com on 4 Nov 2012 at 4:53
Original issue reported on code.google.com by
shibt...@gmail.com
on 4 Nov 2012 at 4:53