summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-08-05 12:01:51 -0400
committerYury Selivanov <yselivanov@sprymix.com>2015-08-05 14:03:42 -0400
commitf57cfc623ad37f35876c4336e051406f871976ed (patch)
tree4a604e9a699bcf7b0271601450c51014425dfcc0
parent1dd213ee66e4b8fbca658652f8b1bc3958707c0b (diff)
downloadtrollius-git-f57cfc623ad37f35876c4336e051406f871976ed.tar.gz
Make sure BaseException is re-raised in SSLProtocol
-rw-r--r--asyncio/sslproto.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/asyncio/sslproto.py b/asyncio/sslproto.py
index e566946..e5ae49a 100644
--- a/asyncio/sslproto.py
+++ b/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.