diff -r c39a5eb3981e asyncio/selector_events.py --- a/asyncio/selector_events.py Tue Nov 25 17:23:22 2014 +0100 +++ b/asyncio/selector_events.py Mon Dec 08 12:19:38 2014 +0100 @@ -72,11 +72,14 @@ raise RuntimeError("Cannot close a running event loop") if self.is_closed(): return - self._close_self_pipe() super().close() if self._selector is not None: self._selector.close() self._selector = None + # Close the pipe after the selector: don't affect the selector if it is + # shared between processes. + # See: http://bugs.python.org/issue21998#msg231819 + self._close_self_pipe() def _socketpair(self): raise NotImplementedError