I'm no compatibility expert, but does xrange need to be imported from six.moves?