def bind_af_aware(sock, addr):
 if (HAS_UNIX_SOCKETS and (sock.family == socket.AF_UNIX)):
  unlink(addr)
 sock.bind(addr)

def bind_af_aware ( sock , addr ) : if ( HAS_UNIX_SOCKETS and ( sock . family == socket . AF_UNIX ) ) : unlink ( addr ) sock . bind ( addr )
helper function to bind a socket according to its family .