[Zope-Checkins] SVN: Zope/trunk/test.py don't muck up the environment if Zope libs are already available

Rob Miller ra at burningman.com
Thu Sep 11 19:28:42 EDT 2008


Log message for revision 91072:
  don't muck up the environment if Zope libs are already available
  

Changed:
  U   Zope/trunk/test.py

-=-
Modified: Zope/trunk/test.py
===================================================================
--- Zope/trunk/test.py	2008-09-11 23:28:11 UTC (rev 91071)
+++ Zope/trunk/test.py	2008-09-11 23:28:41 UTC (rev 91072)
@@ -53,7 +53,11 @@
         zhome = scriptdir
     shome = os.path.join(zhome, 'lib', 'python')
 
-sys.path.insert(0, shome)
+# add SOFTWARE_HOME to sys.path, but only if Zope isn't already available
+try:
+    import Zope2
+except ImportError:
+    sys.path.insert(0, shome)
 
 defaults = '--tests-pattern ^tests$ -v'.split()
 defaults += ['-m',



More information about the Zope-Checkins mailing list