summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-08-05 18:06:53 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-08-05 18:06:53 (GMT)
commite9fadc827598986e646f8dec1b148600163404f2 (patch)
treedf209fac603105c9a3a35815167187a5cd4d3b2f
parentb3c019ca633c62f9f6a5c7a5b422f6e3f9778795 (diff)
parent6703d032a5a695051a1c24847de6d35fd9842242 (diff)
downloadcpython-e9fadc827598986e646f8dec1b148600163404f2.zip
cpython-e9fadc827598986e646f8dec1b148600163404f2.tar.gz
cpython-e9fadc827598986e646f8dec1b148600163404f2.tar.bz2
Merge 3.5 (asyncio)
-rw-r--r--Lib/asyncio/sslproto.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
index e566946..e5ae49a 100644
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -613,7 +613,8 @@ class SSLProtocol(protocols.Protocol):
if data:
ssldata, offset = self._sslpipe.feed_appdata(data, offset)
elif offset:
- ssldata = self._sslpipe.do_handshake(self._on_handshake_complete)
+ ssldata = self._sslpipe.do_handshake(
+ self._on_handshake_complete)
offset = 1
else:
ssldata = self._sslpipe.shutdown(self._finalize)
@@ -637,9 +638,13 @@ class SSLProtocol(protocols.Protocol):
self._write_buffer_size -= len(data)
except BaseException as exc:
if self._in_handshake:
+ # BaseExceptions will be re-raised in _on_handshake_complete.
self._on_handshake_complete(exc)
else:
self._fatal_error(exc, 'Fatal error on SSL transport')
+ if not isinstance(exc, Exception):
+ # BaseException
+ raise
def _fatal_error(self, exc, message='Fatal error on transport'):
# Should be called from exception handler only.