Commit 3f2de803 authored by Tim Graham's avatar Tim Graham
Browse files

Refs #23763 -- Fixed Python 3.5 PendingDeprecationWarning in LazyStream.

Fixed "PendingDeprecationWarning: generator 'LazyStream.read.<locals>.parts'
raised StopIteration" per PEP 0479.
parent cf6ce279
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -327,8 +327,11 @@ class LazyStream(six.Iterator):
            while remaining != 0:
                assert remaining > 0, 'remaining bytes to read should never go negative'

                try:
                    chunk = next(self)

                except StopIteration:
                    return
                else:
                    emitting = chunk[:remaining]
                    self.unget(chunk[remaining:])
                    remaining -= len(emitting)