def _have_socket_can():
 try:
  s = socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW)
 except (AttributeError, OSError):
  return False
 else:
  s.close()
 return True

def _have_socket_can ( ) : try : s = socket . socket ( socket . PF_CAN , socket . SOCK_RAW , socket . CAN_RAW ) except ( AttributeError , OSError ) : return False else : s . close ( ) return True
check whether can sockets are supported on this host .