Replace 'raise StopIteration' with 'return'
With PEP 479, the behaviour of StopIteration is changing. Raising it to stop a generator is considered incorrect and from Python 3.7 this will cause a RuntimeError. The PEP recommends using the return statement. More details: https://www.python.org/dev/peps/pep-0479/#examples-of-breakage Change-Id: Ia067940066a5666926dcf61136b03d721a87666e
This commit is contained in:
parent
bf9e6cea18
commit
b7442c5694
|
@ -125,7 +125,7 @@ class Controller(object):
|
|||
if limit:
|
||||
limit -= 1
|
||||
if limit <= 0:
|
||||
raise StopIteration
|
||||
return
|
||||
|
||||
try:
|
||||
next_url = body['next']
|
||||
|
|
Loading…
Reference in New Issue