Cosmetic change - catching `StopIteration` in a generator function is kind of weird.