Commit 07dc4d49 authored by Stefan H. Holek's avatar Stefan H. Holek

Get the Zope2 path from the selected Python interpreter, which is not

necessarily the same as the one used to run mkzopeinstance.
parent 3f58f94b
......@@ -123,8 +123,7 @@ def main():
# we're on UNIX or we have a nonstandard Windows setup
PYTHON = PYTHONW = python
import Zope2
zope2path = os.path.realpath(os.path.dirname(Zope2.__file__))
zope2path = get_zope2path(PYTHON)
kw = {
"PYTHON":PYTHON,
......@@ -198,5 +197,15 @@ def check_buildout():
parser.read('buildout.cfg')
return 'zopepy' in parser.sections()
def get_zope2path(python):
""" Get Zope2 path from selected Python interpreter.
"""
p = os.popen('"%s" -c"import os, Zope2; '
'print os.path.realpath(os.path.dirname(Zope2.__file__))"' % python)
try:
return p.readline()[:-1]
finally:
p.close()
if __name__ == "__main__":
main()
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