Use six compat for advancing iterator

iter.next() not in python3.