Convert .next() to next(...) for Python 3