[Zodb-checkins] SVN: ZODB/trunk/src/ZODB/DemoStorage.py Do gc if there is no base storage.

Jim Fulton jim at zope.com
Sat Nov 1 14:07:30 EDT 2008


Log message for revision 92739:
  Do gc if there is no base storage.
  

Changed:
  U   ZODB/trunk/src/ZODB/DemoStorage.py

-=-
Modified: ZODB/trunk/src/ZODB/DemoStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/DemoStorage.py	2008-11-01 15:01:48 UTC (rev 92738)
+++ ZODB/trunk/src/ZODB/DemoStorage.py	2008-11-01 18:07:29 UTC (rev 92739)
@@ -194,7 +194,17 @@
             
             return oid
 
-    def pack(self, t, referencesf, gc=False):
+    def pack(self, t, referencesf, gc=None):
+        if gc is None:
+            if self._temporary_base:
+                return self.changes.pack(t, referencesf)
+        elif self._temporary_base:
+            return self.changes.pack(t, referencesf, gc=gc)
+        elif gc:
+            raise TypeError(
+                "Garbage collection isn't supported"
+                " when there is a base storage.")
+        
         try:
             self.changes.pack(t, referencesf, gc=False)
         except TypeError, v:



More information about the Zodb-checkins mailing list