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

victor.stinner python-checkins at python.org
Wed Jan 28 00:35:01 CET 2015


https://hg.python.org/cpython/rev/d61d1e73674f
changeset: 94343:d61d1e73674f
branch: 3.4
parent: 94329:b3f0d7f50544
user: Victor Stinner <victor.stinner at gmail.com>
date: Wed Jan 28 00:30:40 2015 +0100
summary:
 asyncio: sync with Tulip
* Remove unused SSLProtocol._closing attribute
* test_sslproto: skip test if ssl module is missing
* Python issue #23208: Don't use the traceback of the current handle if we
 already know the traceback of the source. The handle may be more revelant,
 but having 3 tracebacks (handle, source, exception) becomes more difficult to
 read. The handle may be preferred later but it requires more work to make
 this choice.
files:
 Lib/asyncio/base_events.py | 3 ++-
 Lib/asyncio/sslproto.py | 1 -
 Lib/test/test_asyncio/test_sslproto.py | 5 +++++
 3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -956,7 +956,8 @@
 else:
 exc_info = False
 
- if (self._current_handle is not None
+ if ('source_traceback' not in context
+ and self._current_handle is not None
 and self._current_handle._source_traceback):
 context['handle_traceback'] = self._current_handle._source_traceback
 
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -408,7 +408,6 @@
 self._write_buffer_size = 0
 
 self._waiter = waiter
- self._closing = False
 self._loop = loop
 self._app_protocol = app_protocol
 self._app_transport = _SSLProtocolTransport(self._loop,
diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py
--- a/Lib/test/test_asyncio/test_sslproto.py
+++ b/Lib/test/test_asyncio/test_sslproto.py
@@ -2,6 +2,10 @@
 
 import unittest
 from unittest import mock
+try:
+ import ssl
+except ImportError:
+ ssl = None
 
 import asyncio
 from asyncio import sslproto
@@ -14,6 +18,7 @@
 self.loop = asyncio.new_event_loop()
 self.set_event_loop(self.loop)
 
+ @unittest.skipIf(ssl is None, 'No ssl module')
 def test_cancel_handshake(self):
 # Python issue #23197: cancelling an handshake must not raise an
 # exception or log an error, even if the handshake failed
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

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