[Zope-CVS] CVS: Packages/autotester - autotest.py:1.4

Chris Withers chrisw at nipltd.com
Fri Sep 26 07:04:07 EDT 2003


Update of /cvs-repository/Packages/autotester
In directory cvs.zope.org:/tmp/cvs-serv26396/autotester

Modified Files:
	autotest.py 
Log Message:
Set PYTHONPATH in a way that works on Linux and Windows.

=== Packages/autotester/autotest.py 1.3 => 1.4 ===
--- Packages/autotester/autotest.py:1.3	Fri Sep 26 06:29:42 2003
+++ Packages/autotester/autotest.py	Fri Sep 26 07:04:06 2003
@@ -158,8 +158,15 @@
             build_dir = os.path.join(dir, "build", "lib.%s" % platspec)
             path.append(os.path.join(self.rootdir, build_dir))
         path = "PYTHONPATH=" + os.pathsep.join(path)
-        self.execute("%s %s -u %s" % (path, self.python, test.script),
-                     logger)
+        try:
+            pythonpath = os.environ.get('PYTHONPATH')
+            os.environ['PYTHONPATH']=path
+            self.execute("%s -u %s" % (self.python, test.script),
+                         logger)
+        finally:
+            if pythonpath is not None:
+                os.environ['PYTHONPATH']=pythonpath
+            
 
     def chdir(self, dir):
         self.logger.info("cd %s" % dir)




More information about the Zope-CVS mailing list