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:
Dougal Matthews 2018-06-29 14:30:53 +01:00
parent bf9e6cea18
commit b7442c5694
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ class Controller(object):
if limit:
limit -= 1
if limit <= 0:
raise StopIteration
return
try:
next_url = body['next']