Commit 092a072b authored by Jeremy Hylton's avatar Jeremy Hylton

Do not raise exception for redundant pack.

And whitespace normalization.
parent 5dcd9b1a
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
# may have a back pointer to a version record or to a non-version # may have a back pointer to a version record or to a non-version
# record. # record.
# #
__version__='$Revision: 1.117 $'[11:-2] __version__='$Revision: 1.118 $'[11:-2]
import base64 import base64
from cPickle import Pickler, Unpickler, loads from cPickle import Pickler, Unpickler, loads
...@@ -1356,9 +1356,9 @@ class FileStorage(BaseStorage.BaseStorage, ...@@ -1356,9 +1356,9 @@ class FileStorage(BaseStorage.BaseStorage,
def _redundant_pack(self, file, pos): def _redundant_pack(self, file, pos):
assert pos > 8, pos assert pos > 8, pos
file.seek(pos-8) file.seek(pos - 8)
p=U64(file.read(8)) p = U64(file.read(8))
file.seek(pos-p+8) file.seek(pos - p + 8)
return file.read(1) not in ' u' return file.read(1) not in ' u'
def pack(self, t, referencesf): def pack(self, t, referencesf):
...@@ -1410,9 +1410,7 @@ class FileStorage(BaseStorage.BaseStorage, ...@@ -1410,9 +1410,7 @@ class FileStorage(BaseStorage.BaseStorage,
if packpos == 4: if packpos == 4:
return return
if self._redundant_pack(file, packpos): if self._redundant_pack(file, packpos):
raise FileStorageError, ( return
'The database has already been packed to a later time\n'
'or no changes have been made since the last pack')
rootl=[z64] rootl=[z64]
pop=rootl.pop pop=rootl.pop
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment