I guess the solution that preserves the original semantics is to return False instead of raising ValueError.