Make range calls py3 compliant

Thanks for the tip, @heynemann