2to3 . --fix xrange -wpn range takes the place of Py2 xrange. Py2 range was a list. Mechanical, did it by hand several times... Ref: https://docs.python.org/3/whatsnew/3.0.html#range