From dfcae2218f542eac1fc2a629db75812eb701205c Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Thu, 8 Jul 2010 14:36:19 +0000
Subject: [PATCH] Factorise zope_home computation.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36988 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/tests/runUnitTest.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/product/ERP5Type/tests/runUnitTest.py b/product/ERP5Type/tests/runUnitTest.py
index 1fba79aa74..779492f4d9 100755
--- a/product/ERP5Type/tests/runUnitTest.py
+++ b/product/ERP5Type/tests/runUnitTest.py
@@ -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:
-- 
2.30.9