run-tests: work around a distutils bug triggered by 0a8a43b4ca75
authorPatrick Mezard <pmezard@gmail.com>
Sun, 22 Nov 2009 19:11:12 +0100
changeset 9905 95517eb3c9a7
parent 9904 ac73cd788853
child 9909 369592fdc2e4
child 9910 6f92997dbdca
run-tests: work around a distutils bug triggered by 0a8a43b4ca75
tests/run-tests.py
--- a/tests/run-tests.py	Sun Nov 22 11:27:29 2009 +0100
+++ b/tests/run-tests.py	Sun Nov 22 19:11:12 2009 +0100
@@ -293,10 +293,18 @@
     script = os.path.realpath(sys.argv[0])
     hgroot = os.path.dirname(os.path.dirname(script))
     os.chdir(hgroot)
+    nohome = '--home=""'
+    if os.name == 'nt':
+        # The --home="" trick works only on OS where os.sep == '/'
+        # because of a distutils convert_path() fast-path. Avoid it at
+        # least on Windows for now, deal with .pydistutils.cfg bugs
+        # when they happen.
+        nohome = ''
     cmd = ('%s setup.py %s clean --all'
            ' install --force --prefix="%s" --install-lib="%s"'
-           ' --install-scripts="%s" --home="" >%s 2>&1'
-           % (sys.executable, pure, INST, PYTHONDIR, BINDIR, installerrs))
+           ' --install-scripts="%s" %s >%s 2>&1'
+           % (sys.executable, pure, INST, PYTHONDIR, BINDIR, nohome,
+              installerrs))
     vlog("# Running", cmd)
     if os.system(cmd) == 0:
         if not options.verbose: