diff options
author | Dougal Matthews <dougal@redhat.com> | 2018-06-29 14:30:53 +0100 |
---|---|---|
committer | Dougal Matthews <dougal@redhat.com> | 2018-06-29 14:31:51 +0100 |
commit | b7442c569496e0d8d2100f9cd62160f2d7b3bcee (patch) | |
tree | 68ad175e7ab98917db36d23cf4de626b256e5279 | |
parent | bf9e6cea186272dda17ad8b874933b2241ee8f97 (diff) | |
download | python-glanceclient-b7442c569496e0d8d2100f9cd62160f2d7b3bcee.tar.gz |
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
-rw-r--r-- | glanceclient/v2/images.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/glanceclient/v2/images.py b/glanceclient/v2/images.py index 89aa912..fbb67a9 100644 --- a/glanceclient/v2/images.py +++ b/glanceclient/v2/images.py @@ -125,7 +125,7 @@ class Controller(object): if limit: limit -= 1 if limit <= 0: - raise StopIteration + return try: next_url = body['next'] |