It used to be for a generator to raise StopIteration was 'good'.. meaning it was a signal to the upstream consumer that stuff was done, but not the preferred way to do this is to simple 'return' from the generator. So anyway remove the raise StopIteration logic in chains.