Patchwork [10,of,13,V2,py3,support] run-tests: if run by python3, execute setup.py with --c2to3

login
register
mail settings
Submitter Augie Fackler
Date Sept. 20, 2013, 2:23 p.m.
Message ID <12b7e3cb4bac7859201a.1379687028@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/2556/
State Accepted
Commit 14c4f605f0fc5944b4ccc0a4b065fa1c97fc702b
Headers show

Comments

Augie Fackler - Sept. 20, 2013, 2:23 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1379618944 14400
#      Thu Sep 19 15:29:04 2013 -0400
# Node ID 12b7e3cb4bac7859201a39179df42cad6511ba1f
# Parent  1c6293f6b4ce2241d525ef815e3f37ca4873d6e8
run-tests: if run by python3, execute setup.py with --c2to3

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -460,6 +460,9 @@ 
     if options.compiler:
         compiler = '--compiler ' + options.compiler
     pure = options.pure and "--pure" or ""
+    py3 = ''
+    if sys.version_info[0] == 3:
+        py3 = '--c2to3'
 
     # Run installer in hg root
     script = os.path.realpath(sys.argv[0])
@@ -472,11 +475,11 @@ 
         # least on Windows for now, deal with .pydistutils.cfg bugs
         # when they happen.
         nohome = ''
-    cmd = ('%(exe)s setup.py %(pure)s clean --all'
+    cmd = ('%(exe)s setup.py %(py3)s %(pure)s clean --all'
            ' build %(compiler)s --build-base="%(base)s"'
            ' install --force --prefix="%(prefix)s" --install-lib="%(libdir)s"'
            ' --install-scripts="%(bindir)s" %(nohome)s >%(logfile)s 2>&1'
-           % dict(exe=sys.executable, pure=pure, compiler=compiler,
+           % dict(exe=sys.executable, py3=py3, pure=pure, compiler=compiler,
                   base=os.path.join(HGTMP, "build"),
                   prefix=INST, libdir=PYTHONDIR, bindir=BINDIR,
                   nohome=nohome, logfile=installerrs))