@@ -496,7 +496,7 @@ class SSLProtocol(object):
496
496
ssldata, appdata = (< _SSLPipe> self ._sslpipe).feed_ssldata(data)
497
497
except ssl_SSLError as e:
498
498
msg = (
499
- f' {self}: SSL error errno:{getattr(e, "errno", "missing")} '
499
+ f' SSL error errno:{getattr(e, "errno", "missing")} '
500
500
f' reason: {getattr(e, "reason", "missing")}'
501
501
)
502
502
self ._fatal_error(e, msg)
@@ -576,7 +576,7 @@ class SSLProtocol(object):
576
576
def _check_handshake_timeout (self ):
577
577
if self ._in_handshake is True :
578
578
msg = (
579
- f" SSL handshake for {self} is taking longer than "
579
+ f" SSL handshake is taking longer than "
580
580
f" {self._ssl_handshake_timeout} seconds: "
581
581
f" aborting the connection"
582
582
)
@@ -594,12 +594,9 @@ class SSLProtocol(object):
594
594
peercert = sslobj.getpeercert()
595
595
except Exception as exc:
596
596
if isinstance (exc, ssl_CertificateError):
597
- msg = (
598
- f' {self}: SSL handshake failed on verifying '
599
- f' the certificate'
600
- )
597
+ msg = ' SSL handshake failed on verifying the certificate'
601
598
else :
602
- msg = f ' {self}: SSL handshake failed'
599
+ msg = ' SSL handshake failed'
603
600
self ._fatal_error(exc, msg)
604
601
return
605
602
@@ -661,15 +658,12 @@ class SSLProtocol(object):
661
658
# delete it and reduce the outstanding buffer size.
662
659
del self ._write_backlog[0 ]
663
660
self ._write_buffer_size -= len (data)
664
- except BaseException as exc:
661
+ except Exception as exc:
665
662
if self ._in_handshake:
666
- # BaseExceptions will be re-raised in _on_handshake_complete.
663
+ # Exceptions will be re-raised in _on_handshake_complete.
667
664
self ._on_handshake_complete(exc)
668
665
else :
669
666
self ._fatal_error(exc, ' Fatal error on SSL transport' )
670
- if not isinstance (exc, Exception ):
671
- # BaseException
672
- raise
673
667
674
668
def _fatal_error (self , exc , message = ' Fatal error on transport' ):
675
669
if self ._transport:
0 commit comments