Do not raise StopIteration
The current code will not work in Python3.7 because of PEP479. This commit fixes it so that it works with both 3.6 and 3.7. [1] https://www.python.org/dev/peps/pep-0479/ Closes-bug: #1815335 Change-Id: I6adf23e0569db8655806a07d53c5000f5fd0918f
This commit is contained in:
parent
db75918208
commit
d54ee8437f
|
@ -241,7 +241,7 @@ class ImageIterator(object):
|
|||
data = image.read(size - bytes_left, length)
|
||||
bytes_left -= len(data)
|
||||
yield data
|
||||
raise StopIteration()
|
||||
return
|
||||
except rbd.ImageNotFound:
|
||||
raise exceptions.NotFound(
|
||||
_('RBD image %s does not exist') % self.name)
|
||||
|
|
|
@ -256,7 +256,7 @@ class ImageIterator(object):
|
|||
data = image.read(total - left, length)
|
||||
left -= len(data)
|
||||
yield data
|
||||
raise StopIteration()
|
||||
return
|
||||
|
||||
|
||||
class Store(glance_store.driver.Store):
|
||||
|
|
Loading…
Reference in New Issue