Merge "Python3:Replace iter.next() with next(iter)"

This commit is contained in:
Jenkins 2016-01-19 03:58:54 +00:00 committed by Gerrit Code Review
commit b18eb81329
2 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@ class GlanceClient(object):
images = self.client.images.list()
while True:
try:
image = images.next()
image = next(images)
yield GlanceClient._format(image)
except StopIteration:
break

View File

@ -179,7 +179,7 @@ def random_name():
@specs.extension_method
def first_or_default(collection, default=None):
try:
return iter(collection).next()
return next(iter(collection))
except StopIteration:
return default