[Zodb-checkins] SVN: ZODB/branches/jim-storage-api-cleanup/src/ZODB/DemoStorage.py Only check for base-storage versions if the base storage supports versions.

Jim Fulton jim at zope.com
Thu Apr 26 13:05:39 EDT 2007


Log message for revision 74792:
  Only check for base-storage versions if the base storage supports versions.
  

Changed:
  U   ZODB/branches/jim-storage-api-cleanup/src/ZODB/DemoStorage.py

-=-
Modified: ZODB/branches/jim-storage-api-cleanup/src/ZODB/DemoStorage.py
===================================================================
--- ZODB/branches/jim-storage-api-cleanup/src/ZODB/DemoStorage.py	2007-04-26 17:05:36 UTC (rev 74791)
+++ ZODB/branches/jim-storage-api-cleanup/src/ZODB/DemoStorage.py	2007-04-26 17:05:38 UTC (rev 74792)
@@ -117,10 +117,16 @@
         self._quota = quota
         self._ltid = None
         self._clear_temp()
-        if base is not None and base.versions():
-            raise POSException.StorageError(
-                "Demo base storage has version data")
 
+        try:
+            versions = base.versions
+        except AttributeError:
+            pass
+        else:
+            if base.versions():
+                raise POSException.StorageError(
+                    "Demo base storage has version data")
+
     # When DemoStorage needs to create a new oid, and there is a base
     # storage, it must use that storage's new_oid() method.  Else
     # DemoStorage may end up assigning "new" oids that are already in use



More information about the Zodb-checkins mailing list