Commit 067bf8a7 authored by Vincent Pelletier's avatar Vincent Pelletier

Reduce scope of try..except KeyError block.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2555 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 390a0810
......@@ -259,15 +259,16 @@ class MQ(object):
try:
data = self._data[key]
except KeyError:
counter = 1
self._mapIndexes('add', (key, ))
else:
level, element, counter = data.level, data.element, data.counter + 1
if level >= 0:
del cache_buffers[level][element]
else:
del self._history_buffer[element]
self._mapIndexes('add', (key, ))
except KeyError:
counter = 1
self._mapIndexes('add', (key, ))
# XXX It might be better to adjust the level according to the object
# size.
......
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