Check the error rather than the presence of the __hash__ attribute to determine if a RuntimeError has occured