[Python-checkins] cpython (merge 3.4 -> default): Merge 3.4 (asyncio)

victor.stinner python-checkins at python.org
Fri Mar 27 15:22:10 CET 2015


https://hg.python.org/cpython/rev/362c43c340a6
changeset: 95217:362c43c340a6
parent: 95215:35bc15fa4930
parent: 95216:e08108d5488e
user: Victor Stinner <victor.stinner at gmail.com>
date: Fri Mar 27 15:20:37 2015 +0100
summary:
 Merge 3.4 (asyncio)
files:
 Lib/asyncio/selector_events.py | 2 +-
 Lib/test/test_asyncio/test_selector_events.py | 5 +++++
 2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -535,7 +535,7 @@
 info.append('closing')
 info.append('fd=%s' % self._sock_fd)
 # test if the transport was closed
- if self._loop is not None:
+ if self._loop is not None and not self._loop.is_closed():
 polling = _test_selector_event(self._loop._selector,
 self._sock_fd, selectors.EVENT_READ)
 if polling:
diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py
--- a/Lib/test/test_asyncio/test_selector_events.py
+++ b/Lib/test/test_asyncio/test_selector_events.py
@@ -62,6 +62,11 @@
 self.loop.add_reader._is_coroutine = False
 transport = self.loop._make_socket_transport(m, asyncio.Protocol())
 self.assertIsInstance(transport, _SelectorSocketTransport)
+
+ # Calling repr() must not fail when the event loop is closed
+ self.loop.close()
+ repr(transport)
+
 close_transport(transport)
 
 @unittest.skipIf(ssl is None, 'No ssl module')
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /