Backout changeset df244fde6aa4 (bug 870420). Temporarily allow older versions of python because people are having trouble getting upgraded. r=bsmedberg_on_irc
authorEKR <ekr@rtfm.com>
Sat, 07 Sep 2013 11:09:47 -0700
changeset 146067 a2c84945e1ef23bd8ae19e52d2f93b1d3acf2cf6
parent 146066 0d651ed131b355f653453597b9b5addfa7147cd6
child 146068 4ca898d7db5fa31399a3cd040f410c02e50b105d
child 146069 dfe69eabbe477ee77e481833995862370a180f74
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbsmedberg_on_irc
bugs870420
milestone26.0a1
backs outdf244fde6aa4db4f2cdbee64d202799874d24469
Backout changeset df244fde6aa4 (bug 870420). Temporarily allow older versions of python because people are having trouble getting upgraded. r=bsmedberg_on_irc
build/virtualenv/populate_virtualenv.py
--- a/build/virtualenv/populate_virtualenv.py
+++ b/build/virtualenv/populate_virtualenv.py
@@ -8,36 +8,20 @@
 from __future__ import print_function, unicode_literals
 
 import distutils.sysconfig
 import os
 import shutil
 import subprocess
 import sys
 
-from distutils.version import StrictVersion
-
 
 # Minimum version of Python required to build.
-MINIMUM_PYTHON_VERSION = StrictVersion('2.7.3')
 MINIMUM_PYTHON_MAJOR = 2
-
-
-UPGRADE_WINDOWS = '''
-Please upgrade to the latest MozillaBuild development environments. See
-https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Windows_Prerequisites
-'''.lstrip()
-
-UPGRADE_OTHER = '''
-Run |mach bootstrap| to ensure your system is up to date.
-
-If you still receive this error, your shell environment is likely detecting
-another Python version. Ensure a modern Python can be found in the paths
-defined by the $PATH environment variable and try again.
-'''.lstrip()
+MINIMUM_PYTHON_MINOR = 7
 
 
 class VirtualenvManager(object):
     """Contains logic for managing virtualenvs for building the tree."""
 
     def __init__(self, topsrcdir, topobjdir, virtualenv_path, log_handle,
         manifest_path):
         """Create a new manager.
@@ -354,30 +338,23 @@ class VirtualenvManager(object):
         and call .ensure() and .activate() to make the virtualenv active.
         """
 
         execfile(self.activate_path, dict(__file__=self.activate_path))
 
 
 def verify_python_version(log_handle):
     """Ensure the current version of Python is sufficient."""
-    major, minor, micro = sys.version_info[:3]
-
-    our = StrictVersion('%d.%d.%d' % (major, minor, micro))
+    major, minor = sys.version_info[:2]
 
-    if major != MINIMUM_PYTHON_MAJOR or our < MINIMUM_PYTHON_VERSION:
-        log_handle.write('Python %s or greater (but not Python 3) is '
-            'required to build. ' % MINIMUM_PYTHON_VERSION)
-        log_handle.write('You are running Python %s.\n' % our)
-
-        if os.name in ('nt', 'ce'):
-            log_handle.write(UPGRADE_WINDOWS)
-        else:
-            log_handle.write(UPGRADE_OTHER)
-
+    if major != MINIMUM_PYTHON_MAJOR or minor < MINIMUM_PYTHON_MINOR:
+        log_handle.write('Python %d.%d or greater (but not Python 3) is '
+            'required to build. ' %
+            (MINIMUM_PYTHON_MAJOR, MINIMUM_PYTHON_MINOR))
+        log_handle.write('You are running Python %d.%d.\n' % (major, minor))
         sys.exit(1)
 
 
 if __name__ == '__main__':
     if len(sys.argv) < 4:
         print('Usage: populate_virtualenv.py /path/to/topsrcdir /path/to/topobjdir /path/to/virtualenv')
         sys.exit(1)