Commit dfcae221 authored by Vincent Pelletier's avatar Vincent Pelletier

Factorise zope_home computation.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36988 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 48dedecb
......@@ -220,8 +220,6 @@ if 'SOFTWARE_HOME' in os.environ:
if not os.path.exists(software_home):
raise ValueError('SOFTWARE_HOME is set to non existing directory %r'
% (software_home,))
# software_home is zope_home/lib/python, remove lib/python
zope_home = os.path.split(os.path.split(software_home)[0])[0]
else:
common_paths = [
'/usr/lib/erp5/lib/python',
......@@ -246,9 +244,11 @@ else:
break
else:
sys.exit('No Zope2 software_home found')
zope_home = os.path.dirname(os.path.dirname(software_home))
os.environ['SOFTWARE_HOME'] = software_home
# software_home is zope_home/lib/python, remove lib/python
zope_home = os.path.dirname(os.path.dirname(software_home))
# SOFTWARE_HOME must be early in sys.path, otherwise some products will
# import ImageFile from PIL instead of from Zope!
if software_home not in sys.path:
......
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