Commit 31089920 authored by Nicolas Dumazet's avatar Nicolas Dumazet

use enumerate() when we need an iterator's item AND index


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32723 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6707b95f
......@@ -494,12 +494,10 @@ class XMLMatrix(Folder):
if not self.index.has_key(cell_id):
return None
i = 0
base_item = self.index[base_id]
for my_id in kw:
for i, my_id in enumerate(kw):
if base_item[i].has_key(my_id):
cell_id += '_%s' % base_item[i][my_id]
i += 1
else:
raise KeyError, 'Invalid key: %s' % str(kw)
......
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