changeset 9905:95517eb3c9a7

run-tests: work around a distutils bug triggered by 0a8a43b4ca75
author Patrick Mezard <pmezard@gmail.com>
date Sun, 22 Nov 2009 19:11:12 +0100
parents ac73cd788853
children 369592fdc2e4 6f92997dbdca
files tests/run-tests.py
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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: