[Checkins] SVN: z3c.zalchemy/trunk/src/z3c/zalchemy/datamanager.py I was too optimistic that the engine exists on _restetEngine, so tests sometimes failed

Michael Howitz mh+zope at gocept.com
Wed Apr 25 07:05:03 EDT 2007


Log message for revision 74745:
  I was too optimistic that the engine exists on _restetEngine, so tests sometimes failed

Changed:
  U   z3c.zalchemy/trunk/src/z3c/zalchemy/datamanager.py

-=-
Modified: z3c.zalchemy/trunk/src/z3c/zalchemy/datamanager.py
===================================================================
--- z3c.zalchemy/trunk/src/z3c/zalchemy/datamanager.py	2007-04-25 09:57:46 UTC (rev 74744)
+++ z3c.zalchemy/trunk/src/z3c/zalchemy/datamanager.py	2007-04-25 11:05:02 UTC (rev 74745)
@@ -57,8 +57,9 @@
         return self.storage.engine
 
     def _resetEngine(self):
-        if self.storage.engine is not None:
-            self.storage.engine.dispose()
+        engine = getattr(self.storage, 'engine', None)
+        if engine is not None:
+            engine.dispose()
             self.storage.engine = None
 
     @property



More information about the Checkins mailing list