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

victor.stinner python-checkins at python.org
Thu Jan 15 13:42:38 CET 2015


https://hg.python.org/cpython/rev/831d71f2811d
changeset: 94173:831d71f2811d
parent: 94170:dc21d72d0f87
parent: 94172:a35b790a2db3
user: Victor Stinner <victor.stinner at gmail.com>
date: Thu Jan 15 13:41:01 2015 +0100
summary:
 Merge 3.4 (asyncio)
files:
 Lib/asyncio/proactor_events.py | 10 ++++++----
 1 files changed, 6 insertions(+), 4 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
@@ -43,12 +43,12 @@
 
 def __repr__(self):
 info = [self.__class__.__name__]
- fd = self._sock.fileno()
- if fd < 0:
+ if self._sock is None:
 info.append('closed')
 elif self._closing:
 info.append('closing')
- info.append('fd=%s' % fd)
+ if self._sock is not None:
+ info.append('fd=%s' % self._sock.fileno())
 if self._read_fut is not None:
 info.append('read=%s' % self._read_fut)
 if self._write_fut is not None:
@@ -72,6 +72,7 @@
 self._loop.call_soon(self._call_connection_lost, None)
 if self._read_fut is not None:
 self._read_fut.cancel()
+ self._read_fut = None
 
 def _fatal_error(self, exc, message='Fatal error on pipe transport'):
 if isinstance(exc, (BrokenPipeError, ConnectionResetError)):
@@ -93,9 +94,10 @@
 self._conn_lost += 1
 if self._write_fut:
 self._write_fut.cancel()
+ self._write_fut = None
 if self._read_fut:
 self._read_fut.cancel()
- self._write_fut = self._read_fut = None
+ self._read_fut = None
 self._pending_write = 0
 self._buffer = None
 self._loop.call_soon(self._call_connection_lost, exc)
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

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