Commit 38e4d83e authored by Georgy Berdyshev's avatar Georgy Berdyshev

Allow to bootstrap on Jython.

Signed-off-by: default avatarGeorgy Berdyshev - Георгий Бердышев <codingmaster@gmail.com>
parent 458489b4
...@@ -24,6 +24,8 @@ import os, shutil, sys, tempfile, urllib2 ...@@ -24,6 +24,8 @@ import os, shutil, sys, tempfile, urllib2
tmpeggs = tempfile.mkdtemp() tmpeggs = tempfile.mkdtemp()
is_jython = sys.platform.startswith('java')
try: try:
import pkg_resources import pkg_resources
except ImportError: except ImportError:
...@@ -46,14 +48,27 @@ else: ...@@ -46,14 +48,27 @@ else:
cmd = 'from setuptools.command.easy_install import main; main()' cmd = 'from setuptools.command.easy_install import main; main()'
ws = pkg_resources.working_set ws = pkg_resources.working_set
assert os.spawnle(
os.P_WAIT, sys.executable, quote (sys.executable), if is_jython:
'-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout', import subprocess
dict(os.environ,
PYTHONPATH= assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
ws.find(pkg_resources.Requirement.parse('setuptools')).location quote(tmpeggs), 'zc.buildout'],
), env=dict(os.environ,
) == 0 PYTHONPATH=
ws.find(pkg_resources.Requirement.parse('setuptools')).location
),
).wait() == 0
else:
assert os.spawnle(
os.P_WAIT, sys.executable, quote (sys.executable),
'-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
dict(os.environ,
PYTHONPATH=
ws.find(pkg_resources.Requirement.parse('setuptools')).location
),
) == 0
ws.add_entry(tmpeggs) ws.add_entry(tmpeggs)
ws.require('zc.buildout') ws.require('zc.buildout')
......
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