Fix incorrect completion order.

This commit is contained in:
Gabben 2019-10-10 19:20:49 +05:00 committed by GitHub
parent 567289f368
commit 2f5415c1c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -361,11 +361,11 @@ class Executor:
await callback(self.dispatcher)
async def _shutdown_polling(self, wait_closed=False):
await self._shutdown()
for callback in self._on_shutdown_polling:
await callback(self.dispatcher)
await self._shutdown()
if wait_closed:
await self.dispatcher.wait_closed()