progressiterator.py: improved end of loop