use python2 compatible generator next