Really fixed error from raising StopIteration in a coroutine.

This commit is contained in:
Andrew Hamilton 2020-05-04 12:31:38 +10:00
parent 3b1da7537f
commit a5cc1163c1

View file

@ -412,10 +412,9 @@ class Summary:
yield result yield result
async def get_closest_placeholder(self): async def get_closest_placeholder(self):
try: if self.closest_placeholder_generator is None:
return self.closest_placeholder_generator.send(None)
except AttributeError:
self.closest_placeholder_generator = self._placeholder_sweep() self.closest_placeholder_generator = self._placeholder_sweep()
try:
return self.closest_placeholder_generator.send(None) return self.closest_placeholder_generator.send(None)
except StopIteration: except StopIteration:
raise StopAsyncIteration raise StopAsyncIteration