[Zope-Checkins] SVN: Zope/trunk/test.py Forward port recent mods from 2.7 branch.

Stefan H. Holek stefan at epy.co.at
Wed Feb 23 06:34:15 EST 2005


Log message for revision 29257:
  Forward port recent mods from 2.7 branch.
  

Changed:
  U   Zope/trunk/test.py

-=-
Modified: Zope/trunk/test.py
===================================================================
--- Zope/trunk/test.py	2005-02-23 10:23:23 UTC (rev 29256)
+++ Zope/trunk/test.py	2005-02-23 11:34:15 UTC (rev 29257)
@@ -369,23 +369,21 @@
 class PathInit:
     def __init__(self, build, libdir=None):
         # Calculate which directories we're going to add to sys.path.
-        self.libdir = "lib/python"
+        self.libdir = os.path.join('lib', 'python')
         # Hack sys.path
         self.home = os.path.dirname(os.path.realpath(sys.argv[0]))
         # test.py lives in $ZOPE_HOME/bin when installed ...
         dir, file = os.path.split(self.home)
         if file == 'bin': self.home = dir
         sys.path.insert(0, os.path.join(self.home, self.libdir))
-        sys.path.insert(0, os.path.join(self.home, self.libdir, 'third_party', 'docutils'))
         self.cwd = os.path.realpath(os.getcwd())
         # Hack again for external products.
         if libdir:
-            self.libdir = os.path.join(self.cwd, libdir)
+            self.libdir = os.path.realpath(os.path.join(self.cwd, libdir))
         else:
-            self.libdir = os.path.join(self.cwd, self.libdir)
-        real_libdir = os.path.realpath(self.libdir)
-        if real_libdir not in sys.path:
-            sys.path.insert(0, real_libdir)
+            self.libdir = os.path.realpath(os.path.join(self.cwd, self.libdir))
+        if self.libdir not in sys.path:
+            sys.path.insert(0, self.libdir)
         # Determine where to look for tests
         if test_dir:
             self.testdir = os.path.abspath(os.path.join(self.cwd, test_dir))



More information about the Zope-Checkins mailing list