# HG changeset patch # User Gregory Szorc # Date 2015-02-07 00:33:05 # Node ID 4bf4842767873c0f77ca50551e4f726120f76e39 # Parent 4d9c738d942f1dd2c5833c2c3dec377f0c733015 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. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1863,6 +1863,17 @@ class TestRunner(object): '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: