[Zope-Checkins] SVN: Zope/trunk/lib/python/Testing/ZopeTestCase/ZopeLite.py Remove some backward compatibility baggage.

Stefan H. Holek stefan at epy.co.at
Mon Oct 4 11:34:01 EDT 2004


Log message for revision 27736:
  Remove some backward compatibility baggage.
  


Changed:
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/ZopeLite.py


-=-
Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/ZopeLite.py
===================================================================
--- Zope/trunk/lib/python/Testing/ZopeTestCase/ZopeLite.py	2004-10-04 15:24:14 UTC (rev 27735)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/ZopeLite.py	2004-10-04 15:34:01 UTC (rev 27736)
@@ -42,32 +42,27 @@
 _write('Loading Zope, please stand by ')
 _start = time.time()
 
-# Zope 2.7 specifics
-try: 
-    import App.config
-except ImportError:
-    pass # Zope < 2.7
-else:
-    # Configure logging
-    if not sys.modules.has_key('logging'):
-        import logging
-        logging.basicConfig()
-    # Need to import Zope early on as the 
-    # ZTUtils package relies on it
-    config = App.config.getConfiguration()
-    config.debug_mode = 0
-    App.config.setConfiguration(config)
-    _exec('import Zope')
-    import Zope
+# Configure logging
+if not sys.modules.has_key('logging'):
+    import logging
+    logging.basicConfig()
 
+# Debug mode is dog slow ...
+import App.config
+config = App.config.getConfiguration()
+config.debug_mode = 0
+App.config.setConfiguration(config)
+
+# Need to import Zope early on as the 
+# ZTUtils package relies on it
+_exec('import Zope')
+import Zope
 _exec('import ZODB')
 import ZODB
 _write('.')
 
 _exec('import Globals')
 import Globals
-# Work around a bug in Zope 2.7.0
-Globals.DevelopmentMode = 0
 _exec('import OFS.SimpleItem')
 import OFS.SimpleItem
 _exec('import OFS.ObjectManager')
@@ -97,11 +92,6 @@
 # Make sure to use a temporary client cache
 if os.environ.get('ZEO_CLIENT'): del os.environ['ZEO_CLIENT']
 
-# Load Zope (< 2.7)
-_exec('import Zope')
-import Zope
-_write('.')
-
 from OFS.Application import get_folder_permissions, get_products, install_product
 from OFS.Folder import Folder
 import Products
@@ -157,11 +147,8 @@
 app = Zope.app
 debug = Zope.debug
 DB = Zope.DB
-# startup appeared in Zope 2.6.1
+configure = Zope.configure
 def startup(): pass
-# configure appeared in Zope 2.7
-try: configure = Zope.configure
-except AttributeError: pass 
 
 from ZODB.DemoStorage import DemoStorage
 def sandbox(base=None):



More information about the Zope-Checkins mailing list