Merge 3.6 (issue #28500)

This commit is contained in:
Yury Selivanov 2016-10-21 17:14:17 -04:00
commit f5cd8a29f3
1 changed files with 3 additions and 0 deletions

View File

@ -351,6 +351,9 @@ class BaseEventLoop(events.AbstractEventLoop):
self._asyncgens.discard(agen)
if not self.is_closed():
self.create_task(agen.aclose())
# Wake up the loop if the finalizer was called from
# a different thread.
self._write_to_self()
def _asyncgen_firstiter_hook(self, agen):
if self._asyncgens_shutdown_called: