Browse Source

Merge "Handle StopIteration for Py3.7 PEP 0479"

Zuul 6 months ago
parent
commit
e5e1cc439c
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      glance/tests/unit/api/test_common.py
  2. 1
    1
      glance/tests/unit/common/test_utils.py

+ 1
- 1
glance/tests/unit/api/test_common.py View File

@@ -34,7 +34,7 @@ class SimpleIterator(object):
34 34
             yield chunk
35 35
             chunk = read_chunk()
36 36
         else:
37
-            raise StopIteration()
37
+            return
38 38
 
39 39
 
40 40
 class TestSizeCheckedIter(testtools.TestCase):

+ 1
- 1
glance/tests/unit/common/test_utils.py View File

@@ -87,7 +87,7 @@ class TestUtils(test_utils.BaseTestCase):
87 87
             yield chunk
88 88
             iteration += 1
89 89
             if iteration >= max_iterations:
90
-                raise StopIteration()
90
+                return
91 91
 
92 92
     def _test_reader_chunked(self, chunk_size, read_size, max_iterations=5):
93 93
         generator = self._create_generator(chunk_size, max_iterations)

Loading…
Cancel
Save