changeset 24075:4bf484276787

run-tests: ensure install directories exist As part of the transition to setuptools, it was discovered that setuptools doesn't create install directories for you where distutils apparently did. This was causing run-tests.py to fail when creating the temporary hg install. We work around this problem by creating the install directories before running setup.py.
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 06 Feb 2015 16:33:05 -0800
parents 4d9c738d942f
children b53d2afd11fb
files tests/run-tests.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Fri Feb 06 16:15:02 2015 -0800
+++ b/tests/run-tests.py	Fri Feb 06 16:33:05 2015 -0800
@@ -1863,6 +1863,17 @@
                   'prefix': self._installdir, 'libdir': self._pythondir,
                   'bindir': self._bindir,
                   'nohome': nohome, 'logfile': installerrs})
+
+        # setuptools requires install directories to exist.
+        def makedirs(p):
+            try:
+                os.makedirs(p)
+            except OSError, e:
+                if e.errno != errno.EEXIST:
+                    raise
+        makedirs(self._pythondir)
+        makedirs(self._bindir)
+
         vlog("# Running", cmd)
         if os.system(cmd) == 0:
             if not self.options.verbose: