[Python-checkins] cpython (3.4): asyncio: sync with Tulip

victor.stinner python-checkins at python.org
Mon Jul 7 18:09:36 CEST 2014


http://hg.python.org/cpython/rev/f59e0d618be2
changeset:   91585:f59e0d618be2
branch:      3.4
parent:      91583:1ae8f66ec068
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Jul 07 18:08:22 2014 +0200
summary:
  asyncio: sync with Tulip

Backout the "Tulip issue 181: Faster create_connection()" changeset, it was a
mistake.

files:
  Lib/asyncio/proactor_events.py |  2 +-
  Lib/asyncio/selector_events.py |  2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py
--- a/Lib/asyncio/proactor_events.py
+++ b/Lib/asyncio/proactor_events.py
@@ -38,7 +38,7 @@
             self._server.attach(self)
         self._loop.call_soon(self._protocol.connection_made, self)
         if waiter is not None:
-            waiter.set_result(None)
+            self._loop.call_soon(waiter._set_result_unless_cancelled, None)
 
     def _set_extra(self, sock):
         self._extra['pipe'] = sock
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
@@ -481,7 +481,7 @@
         self._loop.add_reader(self._sock_fd, self._read_ready)
         self._loop.call_soon(self._protocol.connection_made, self)
         if waiter is not None:
-            waiter.set_result(None)
+            self._loop.call_soon(waiter._set_result_unless_cancelled, None)
 
     def pause_reading(self):
         if self._closing:

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list