[Zope-dev] [Zope-Checkins] SVN: zdaemon/trunk/bootstrap.py Added support to bootstrap on Jython.

Chris Withers chris at simplistix.co.uk
Fri Sep 5 04:20:35 EDT 2008


Georgy Berdyshev wrote:
> +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
> +

If subprocess works on Jython, why does it *not* work on CPython?

ie: If subprocess works, why not use it everywhere.

Also, I do hope you're aware that bootstrap.py isn't "owned" by zdaemon, 
it's part of the zc.buildout project, so it seems a little odd making 
these changes to bootstrap.py here...

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope-Dev mailing list