Fix StopIteration error on Python >= 3.7

1 job for fix_stop_iteration in 44 seconds (queued for 9 seconds)