Bug 599743 - End-of-life Python 2.4 for build support, in c-c; (Av1a) client.py part.
☠☠ backed out by 55311f5d4576 ☠ ☠
authorSerge Gautherie <sgautherie.bz@free.fr>
Mon, 27 Sep 2010 01:57:59 +0200
changeset 6431 25e697e42d9a9a47f537b19ea0f68785aa68e3fd
parent 6430 a7262e7a2fff00a3fc5b7e4f5c7b5a2f12c4788f
child 6432 e68e000957edce52958575c4ea0231cf6fb9f311
child 6468 55311f5d4576d28b364da2b1d6a20a47ca77131b
push idunknown
push userunknown
push dateunknown
bugs599743
Bug 599743 - End-of-life Python 2.4 for build support, in c-c; (Av1a) client.py part. r=Callek.
client.py
--- a/client.py
+++ b/client.py
@@ -51,46 +51,35 @@ SWITCH_MOZILLA_REPO_BACKUP_LOCATION = ".
 # switched. Can be blank for no effect.
 SWITCH_MOZILLA_REPO_OLD_REPO_LOCATION = ".mozilla-trunk"
 # This should be the same as DEFAULTS['MOZILLA_REPO'] but using %s instead of http
 # for the scheme.
 SWITCH_MOZILLA_REPO_REPLACE = '%s://hg.mozilla.org/mozilla-central/'
 SWITCH_MOZILLA_BASE_REV = "GECKO_1_9_1_BASE"
 
 import sys
-# Test Python Version. 2.4 required for `import subprocess`
+# Check Python version: 2.5+ is required for `from subprocess import check_call`.
 pyver = sys.version_info
-if pyver[0] <= 1 or (pyver[0] == 2 and pyver[1] < 4):
-  sys.exit("ERROR: Python 2.4 or newer required")
+if pyver[0] <= 1 or (pyver[0] == 2 and pyver[1] < 5):
+  sys.exit("ERROR: Python 2.5 or newer required")
 elif pyver[0] >= 3:
-  sys.exit("ERROR: Python series 3 is not supported, use series 2 > 2.4")
+  sys.exit("ERROR: Python series 3 is not supported, use series 2 >= 2.5")
 del pyver
 
 import os
 import datetime
 from optparse import OptionParser, OptionValueError
+from subprocess import check_call
 
 topsrcdir = os.path.dirname(__file__)
 if topsrcdir == '':
     topsrcdir = '.'
 
 TREE_STATE_FILE = os.path.join(topsrcdir, '.treestate')
 
-try:
-    from subprocess import check_call
-except ImportError:
-    import subprocess
-    def check_call(*popenargs, **kwargs):
-        retcode = subprocess.call(*popenargs, **kwargs)
-        if retcode:
-            cmd = kwargs.get("args")
-            if cmd is None:
-                cmd = popenargs[0]
-                raise Exception("Command '%s' returned non-zero exit status %i" % (cmd, retcode))
-
 def check_call_noisy(cmd, retryMax=0, *args, **kwargs):
   """Wrapper around execute_check_call() to allow retries before failing.
 
   |cmd|, is the command to try and execute.
   |retryMax|, is the maximum number of retries to attempt, 0 by default.
   """
 
   def execute_check_call(cmd, *args, **kwargs):