#NEWLINE# def _safe_ssl_call( self , suppress_ragged_eofs , call , * args , **kwargs ) : #NEWLINE# #INDENT# 'Wrap the given call with SSL error-trapping.' #NEWLINE# start = time . time ( ) #NEWLINE# while True : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return call ( * args , ** kwargs ) #NEWLINE# #UNINDENT# except ( ossl . WantReadError , ossl . WantWriteError ) : #NEWLINE# #INDENT# time . sleep ( self . SSL_RETRY ) #NEWLINE# #UNINDENT# except ossl . Error as e : #NEWLINE# #INDENT# if ( suppress_ragged_eofs and ( e . args == ( ( - 1 ) , 'Unexpected EOF' ) ) ) : #NEWLINE# #INDENT# return b'' #NEWLINE# #UNINDENT# raise socket . error ( e . args [ 0 ] ) #NEWLINE# #UNINDENT# if ( ( time . time ( ) - start ) > self . SSL_TIMEOUT ) : #NEWLINE# #INDENT# raise socket . timeout ( 'timed out' )