[Zope-Checkins] SVN: Zope/branches/jim-fix-zclasses/lib/python/OFS/tests/testProductInit.py Added clean-up code to remove non-exixtent directoris from products

Jim Fulton jim at zope.com
Fri Apr 1 06:24:31 EST 2005


Log message for revision 29776:
  Added clean-up code to remove non-exixtent directoris from products
  path.
  

Changed:
  U   Zope/branches/jim-fix-zclasses/lib/python/OFS/tests/testProductInit.py

-=-
Modified: Zope/branches/jim-fix-zclasses/lib/python/OFS/tests/testProductInit.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/OFS/tests/testProductInit.py	2005-04-01 11:24:29 UTC (rev 29775)
+++ Zope/branches/jim-fix-zclasses/lib/python/OFS/tests/testProductInit.py	2005-04-01 11:24:31 UTC (rev 29776)
@@ -19,6 +19,7 @@
 import Zope2.Startup
 import ZConfig
 from App.config import getConfiguration, setConfiguration
+import Products
 
 TEMPNAME = tempfile.mktemp()
 TEMPPRODUCTS = os.path.join(TEMPNAME, "Products")
@@ -84,6 +85,8 @@
         del self.schema
         App.config.setConfiguration(original_config)
         shutil.rmtree(TEMPNAME)
+        Products.__path__ = [d for d in Products.__path__
+                             if os.path.exists(d)]
 
     def configure(self, text):
         # We have to create a directory of our own since the existence



More information about the Zope-Checkins mailing list