diff --git a/server/fishtest/rundb.py b/server/fishtest/rundb.py index 7c46d32a9..b8277ee95 100644 --- a/server/fishtest/rundb.py +++ b/server/fishtest/rundb.py @@ -89,11 +89,12 @@ def __init__(self, generator): def read(self, size=-1): while size < 0 or len(self.buffer) < size: try: - self.buffer += next(self.generator) + chunk = next(self.generator) + self.buffer += chunk + result, self.buffer = self.buffer[:size], self.buffer[size:] + yield result except StopIteration: break - result, self.buffer = self.buffer[:size], self.buffer[size:] - return result def close(self): pass # No cleanup needed, but method is required