Commit 4d14d8f0 authored by Jim Fulton's avatar Jim Fulton

stop usinf os.spawn (and _safe_arg where not needed)

parent 340dcabf
...@@ -111,19 +111,14 @@ def get(url): ...@@ -111,19 +111,14 @@ def get(url):
def _runsetup(setup, executable, *args): def _runsetup(setup, executable, *args):
if os.path.isdir(setup): if os.path.isdir(setup):
setup = os.path.join(setup, 'setup.py') setup = os.path.join(setup, 'setup.py')
d = os.path.dirname(setup) args = list(args)
args = [zc.buildout.easy_install._safe_arg(arg)
for arg in args]
args.insert(0, '-q') args.insert(0, '-q')
args.append(dict(os.environ, PYTHONPATH=setuptools_location))
here = os.getcwd() here = os.getcwd()
try: try:
os.chdir(d) os.chdir(os.path.dirname(setup))
os.spawnle(os.P_WAIT, executable, zc.buildout.easy_install.call_subprocess(
zc.buildout.easy_install._safe_arg(executable), [executable, setup] + args,
setup, *args) env=dict(os.environ, PYTHONPATH=setuptools_location))
if os.path.exists('build'): if os.path.exists('build'):
rmtree('build') rmtree('build')
finally: finally:
......
...@@ -2813,17 +2813,16 @@ def getWorkingSetWithBuildoutEgg(test): ...@@ -2813,17 +2813,16 @@ def getWorkingSetWithBuildoutEgg(test):
# We have a develop egg, create a real egg for it: # We have a develop egg, create a real egg for it:
here = os.getcwd() here = os.getcwd()
os.chdir(os.path.dirname(dist.location)) os.chdir(os.path.dirname(dist.location))
assert os.spawnle( zc.buildout.easy_install.call_subprocess(
os.P_WAIT, sys.executable, [sys.executable,
zc.buildout.easy_install._safe_arg(sys.executable), os.path.join(os.path.dirname(dist.location), 'setup.py'),
os.path.join(os.path.dirname(dist.location), 'setup.py'), '-q', 'bdist_egg', '-d', eggs],
'-q', 'bdist_egg', '-d', eggs, env=dict(os.environ,
dict(os.environ, PYTHONPATH=pkg_resources.working_set.find(
PYTHONPATH=pkg_resources.working_set.find( pkg_resources.Requirement.parse('setuptools')
pkg_resources.Requirement.parse('setuptools') ).location,
).location, ),
), )
) == 0
os.chdir(here) os.chdir(here)
os.remove(os.path.join(eggs, 'zc.buildout.egg-link')) os.remove(os.path.join(eggs, 'zc.buildout.egg-link'))
......
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