Issue #28368: Refuse monitoring processes if the child watcher has no loop attached.

Patch by Vincent Michel.
This commit is contained in:
Yury Selivanov 2016-10-05 16:57:12 -04:00
parent b5bb404cca
commit 9eb6c67776
4 changed files with 42 additions and 6 deletions

View file

@ -433,6 +433,13 @@ def kill_running():
# the transport was not notified yet
self.assertFalse(killed)
# Unlike SafeChildWatcher, FastChildWatcher does not pop the
# callbacks if waitpid() is called elsewhere. Let's clear them
# manually to avoid a warning when the watcher is detached.
if sys.platform != 'win32' and \
isinstance(self, SubprocessFastWatcherTests):
asyncio.get_child_watcher()._callbacks.clear()
def test_popen_error(self):
# Issue #24763: check that the subprocess transport is closed
# when BaseSubprocessTransport fails