Merge "Python3:Replace iter.next() with next(iter)"
This commit is contained in:
commit
b18eb81329
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue