Merge "Handle StopIteration for Py3.7"
This commit is contained in:
@@ -395,7 +395,10 @@ class ResponseBodyIterator(object):
|
|||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
while True:
|
while True:
|
||||||
yield self.next()
|
try:
|
||||||
|
yield self.next()
|
||||||
|
except StopIteration:
|
||||||
|
return
|
||||||
|
|
||||||
def next(self):
|
def next(self):
|
||||||
chunk = self.resp.read(CHUNKSIZE)
|
chunk = self.resp.read(CHUNKSIZE)
|
||||||
|
Reference in New Issue
Block a user