Bug 1234954 - Use LooseVersion for parsing Mercurial version; r=me

StrictVersion is strict about version strings, insisting on whatever
convention Python uses. LooseVersion is not as strict but is strict
enough for our use cases.

DONTBUILD (NPOTB)
This commit is contained in:
Gregory Szorc 2015-12-31 16:14:20 -08:00
parent b3a8b8578e
commit 4329c55426

View File

@ -10,7 +10,6 @@ import subprocess
import sys
from distutils.version import LooseVersion
from distutils.version import StrictVersion
NO_MERCURIAL = '''
@ -76,7 +75,7 @@ We recommend the following tools for installing Python:
# Upgrade Mercurial older than this.
# This should match OLDEST_NON_LEGACY_VERSION from
# tools/mercurial/hgsetup/wizard.py.
MODERN_MERCURIAL_VERSION = StrictVersion('3.5.2')
MODERN_MERCURIAL_VERSION = LooseVersion('3.5.2')
# Upgrade Python older than this.
MODERN_PYTHON_VERSION = LooseVersion('2.7.3')
@ -294,7 +293,7 @@ class BaseBootstrapper(object):
print('ERROR: Unable to identify Mercurial version.')
return True, False, None
our = StrictVersion(match.group(1))
our = LooseVersion(match.group(1))
return True, our >= MODERN_MERCURIAL_VERSION, our