def SslWrapOnlyOnce(org_sslwrap, sock, *args, **kwargs):
 if (not isinstance(sock, ssl.SSLSocket)):
  ctx = Master.get_fd_context(sock.fileno())
  try:
   sock = org_sslwrap(sock, *args, **kwargs)
   ctx.encryption = _explain_encryption(sock)
  except (socket.error, IOError) as e:
   ctx.error = ('%s' % e)
   raise
 return sock

def SslWrapOnlyOnce ( org_sslwrap , sock , * args , ** kwargs ) : if ( not isinstance ( sock , ssl . SSLSocket ) ) : ctx = Master . get_fd_context ( sock . fileno ( ) ) try : sock = org_sslwrap ( sock , * args , ** kwargs ) ctx . encryption = _explain_encryption ( sock ) except ( socket . error , IOError ) as e : ctx . error = ( '%s' % e ) raise return sock
since we like to wrap things our own way .