diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-11-20 23:23:59 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-11-20 23:23:59 (GMT) |
commit | 35830270e1db09a4ccffc4495c5c6e662236d8ad (patch) | |
tree | c1ab768773ec92ec63799935ceefc62757458985 /Lib | |
parent | bca6ae67d6f7656d6b6024e9670ea609e5a18df5 (diff) | |
parent | 5e63120f8d1593700f8d5813c535d318c8bab111 (diff) | |
download | cpython-35830270e1db09a4ccffc4495c5c6e662236d8ad.zip cpython-35830270e1db09a4ccffc4495c5c6e662236d8ad.tar.gz cpython-35830270e1db09a4ccffc4495c5c6e662236d8ad.tar.bz2 |
(Merge 3.4) asyncio: BaseSelectorEventLoop.close() now closes the self-pipe
before calling the parent close() method. If the event loop is already closed,
the self-pipe is not unregistered from the selector.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/asyncio/selector_events.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index 116d380..f0c94c4 100644 --- a/Lib/asyncio/selector_events.py +++ b/Lib/asyncio/selector_events.py @@ -68,10 +68,12 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop): address, waiter, extra) def close(self): + if self._running: + raise RuntimeError("Cannot close a running event loop") if self.is_closed(): return - super().close() self._close_self_pipe() + super().close() if self._selector is not None: self._selector.close() self._selector = None |