That should be equivalent, as when an exception is raised, the return value from `PyIter_Next` will be NULL.