[Zodb-checkins] CVS: StandaloneZODB/ZODB - FileStorage.py:1.83

Jeremy Hylton jeremy@zope.com
Thu, 28 Mar 2002 15:21:00 -0500


Update of /cvs-repository/StandaloneZODB/ZODB
In directory cvs.zope.org:/tmp/cvs-serv19536

Modified Files:
	FileStorage.py 
Log Message:
Replace more KeyErrors with POSKeyErrors


=== StandaloneZODB/ZODB/FileStorage.py 1.82 => 1.83 ===
     def load(self, oid, version, _stuff=None):
         self._lock_acquire()
-        try: return self._load(oid, version, self._index, self._file)
-        finally: self._lock_release()
+        try:
+            return self._load(oid, version, self._index, self._file)
+        finally:
+            self._lock_release()
 
     def loadSerial(self, oid, serial):
         self._lock_acquire()
         try:
-            _index=self._index
             file=self._file
             seek=file.seek
             read=file.read
             try:
-                pos=_index[oid]
+                pos = self._index[oid]
             except KeyError:
                 raise POSKeyError(oid)
             while 1:
@@ -619,7 +620,10 @@
     def modifiedInVersion(self, oid):
         self._lock_acquire()
         try:
-            pos=self._index[oid]
+            try:
+                pos = self._index[oid]
+            except KeyError:
+                raise POSKeyError(oid)
             file=self._file
             seek=file.seek
             seek(pos)