changeset 19758:14c4f605f0fc

run-tests: if run by python3, execute setup.py with --c2to3
author Augie Fackler <raf@durin42.com>
date Thu, 19 Sep 2013 15:29:04 -0400
parents ff00839e8bb3
children 1b8054b98d68
files tests/run-tests.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Thu Sep 19 15:28:26 2013 -0400
+++ b/tests/run-tests.py	Thu Sep 19 15:29:04 2013 -0400
@@ -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))