Commit ba283431 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Test empty history condition before.

This allow raise KeyError even for getSerial().

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1802 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 92c8fa10
...@@ -905,15 +905,16 @@ class Application(object): ...@@ -905,15 +905,16 @@ class Application(object):
if not isinstance(self.local_var.history, tuple): if not isinstance(self.local_var.history, tuple):
raise NEOStorageError('history failed') raise NEOStorageError('history failed')
if object_only:
# Use by getSerial
return self.local_var.history
if self.local_var.history[1] == []: if self.local_var.history[1] == []:
# KeyError expected if no history was found # KeyError expected if no history was found
# XXX: this may requires an error from the storages # XXX: this may requires an error from the storages
raise KeyError raise KeyError
if object_only:
# Use by getSerial
return self.local_var.history
# Now that we have object informations, get txn informations # Now that we have object informations, get txn informations
history_list = [] history_list = []
for serial, size in self.local_var.history[1]: for serial, size in self.local_var.history[1]:
......
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