Improve python3 compatibility with next() built-in
Merge pull request #5196 from basepi/virtrunner5120

Improve python3 compatibility with next() built-in