[Zodb-checkins] SVN: zdaemon/trunk/bootstrap.py Added support to bootstrap on Jython.
Georgy Berdyshev
codingmaster at gmail.com
Wed Aug 27 18:52:13 EDT 2008
Log message for revision 90484:
Added support to bootstrap on Jython.
Signed-off-by: Georgy Berdyshev - ?\208?\147?\208?\181?\208?\190?\209?\128?\208?\179?\208?\184?\208?\185 ?\208?\145?\208?\181?\209?\128?\208?\180?\209?\139?\209?\136?\208?\181?\208?\178 <codingmaster at gmail.com>
Changed:
U zdaemon/trunk/bootstrap.py
-=-
Modified: zdaemon/trunk/bootstrap.py
===================================================================
--- zdaemon/trunk/bootstrap.py 2008-08-27 22:45:01 UTC (rev 90483)
+++ zdaemon/trunk/bootstrap.py 2008-08-27 22:52:13 UTC (rev 90484)
@@ -31,16 +31,34 @@
import pkg_resources
+is_jython = sys.platform.startswith('java')
+
+if is_jython:
+ import subprocess
+
ws = pkg_resources.working_set
-assert os.spawnle(
- os.P_WAIT, sys.executable, sys.executable,
- '-c', 'from setuptools.command.easy_install import main; main()',
- '-mqNxd', tmpeggs, 'zc.buildout',
- {'PYTHONPATH':
- ws.find(pkg_resources.Requirement.parse('setuptools')).location
- },
- ) == 0
+if is_jython:
+ assert subprocess.Popen(
+ [sys.executable] + ['-c',
+ 'from setuptools.command.easy_install import main; main()',
+ '-mqNxd', tmpeggs, 'zc.buildout'],
+ env = dict(
+ PYTHONPATH =
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ).wait() == 0
+
+else:
+ assert os.spawnle(
+ os.P_WAIT, sys.executable, sys.executable,
+ '-c', 'from setuptools.command.easy_install import main; main()',
+ '-mqNxd', tmpeggs, 'zc.buildout',
+ {'PYTHONPATH':
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ },
+ ) == 0
+
ws.add_entry(tmpeggs)
ws.require('zc.buildout')
import zc.buildout.buildout
More information about the Zodb-checkins
mailing list