fix cycle.next iterator to py3 compat.