Commit 3501e73d authored by Roel Bruggink's avatar Roel Bruggink Committed by Hanno Schlichting

Raise POSKeyError instead of KeyError in loadBefore. (#6)

This prevents a KeyError: '\x00\x00\x00\x00\x00\x00\x00\x00'
parent 696db9aa
...@@ -3,6 +3,7 @@ Changelog ...@@ -3,6 +3,7 @@ Changelog
4.0.1 - unreleased 4.0.1 - unreleased
------------------ ------------------
- Raise POSKeyError instead of KeyError in loadBefore.
4.0 - 2017-03-09 4.0 - 2017-03-09
......
...@@ -184,7 +184,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage): ...@@ -184,7 +184,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
with self._lock: with self._lock:
tids = [stid for soid, stid in self._conflict_cache if soid == oid] tids = [stid for soid, stid in self._conflict_cache if soid == oid]
if not tids: if not tids:
raise KeyError(oid) raise POSException.POSKeyError(oid)
tids.sort() tids.sort()
i = bisect.bisect_left(tids, tid) - 1 i = bisect.bisect_left(tids, tid) - 1
if i == -1: if i == -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