[Zope3-checkins] CVS: ZODB4/ZODB - FileStorage.py:1.110.6.8

Jeremy Hylton jeremy@zope.com
Wed, 11 Dec 2002 18:21:44 -0500


Update of /cvs-repository/ZODB4/ZODB
In directory cvs.zope.org:/tmp/cvs-serv15722/ZODB

Modified Files:
      Tag: ZODB4-Q-branch
	FileStorage.py 
Log Message:
Expect that fsIndex is always available.
Use _clear_index() method.



=== ZODB4/ZODB/FileStorage.py 1.110.6.7 => 1.110.6.8 ===
--- ZODB4/ZODB/FileStorage.py:1.110.6.7	Wed Dec 11 16:23:13 2002
+++ ZODB4/ZODB/FileStorage.py	Wed Dec 11 18:21:44 2002
@@ -139,12 +139,7 @@
 from ZODB.TimeStamp import TimeStamp, newTimeStamp, timeStampFromTime
 from ZODB.lock_file import lock_file
 from ZODB.utils import p64, u64, cp, z64
-
-try:
-    from ZODB.fsIndex import fsIndex
-except ImportError:
-    def fsIndex():
-        return {}
+from ZODB.fsIndex import fsIndex
 
 from zLOG import LOG, BLATHER, WARNING, ERROR, PANIC
 
@@ -341,10 +336,7 @@
         if self._file is None and create:
             if os.path.exists(file_name):
                 os.remove(file_name)
-                try:
-                    os.remove(file_name + ".index")
-                except os.error:
-                    pass
+                self._clear_index()
             self._file = open(file_name, 'w+b')
             self._file.write(packed_version)