Apply Eric's Unicode version-parsing fix.
@@ -11,7 +11,6 @@ from packaging.version import InvalidVersion
from readthedocs.builds.constants import LATEST_VERBOSE_NAME
from readthedocs.builds.constants import STABLE_VERBOSE_NAME
import six
-from six.moves import range
def get_major(version):
@@ -114,7 +113,8 @@ def version_windows(versions, major=1, minor=1, point=1):
def parse_version_failsafe(version_string):
try:
return Version(
- unicodedata.normalize('NFKD', six.text_type(version_string)).encode('ascii', 'ignore')
+ six.text_type(
+ unicodedata.normalize('NFKD', six.text_type(version_string)))
)
except (UnicodeError, InvalidVersion):
return None
