Instead, you might do `range = xrange` in the Python 2 detection block.