Commit 2988952f authored by Philip Thiem's avatar Philip Thiem

Earlier Versions of python used gzip and tar directly. So I need to

make sure they are in the paths for the legacy tests (why did it work before).
Let us hope that svn is not in that directory...
parent 76423012
...@@ -107,6 +107,15 @@ class ZippedEnvironment(unittest.TestCase): ...@@ -107,6 +107,15 @@ class ZippedEnvironment(unittest.TestCase):
pass pass
def _which_dirs(cmd):
result = set()
for path in os.environ.get('PATH', '').split(os.pathsep):
filename = os.path.join(path, cmd)
if os.access(filename, os.X_OK):
result.add(path)
return result
def run_setup_py(cmd, pypath=None, path=None, def run_setup_py(cmd, pypath=None, path=None,
data_stream=0, env=None): data_stream=0, env=None):
""" """
...@@ -115,22 +124,19 @@ def run_setup_py(cmd, pypath=None, path=None, ...@@ -115,22 +124,19 @@ def run_setup_py(cmd, pypath=None, path=None,
""" """
if env is None: if env is None:
env = dict() env = dict()
for envname in os.environ:
env[envname] = os.environ[envname]
#override the python path if needed #override the python path if needed
if pypath is None: if pypath is not None:
env["PYTHONPATH"] = os.environ.get("PYTHONPATH", "")
else:
env["PYTHONPATH"] = pypath env["PYTHONPATH"] = pypath
#oeride the execution path if needed #overide the execution path if needed
if path is None: if path is not None:
env["PATH"] = os.environ.get("PATH", "") env["PATH"] = path
else: if not env.get("PATH", ""):
env["PATH"] = pypath env["PATH"] = _which_dirs("tar").union(_which_dirs("gzip"))
env["PATH"] = os.pathsep.join(env["PATH"])
#Apparently this might be needed in windows platforms
if "SYSTEMROOT" in os.environ:
env["SYSTEMROOT"] = os.environ["SYSTEMROOT"]
cmd = [sys.executable, "setup.py"] + list(cmd) cmd = [sys.executable, "setup.py"] + list(cmd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment