Commit 139a3740 authored by Jérome Perrin's avatar Jérome Perrin

use getattr instead of hasattr


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15778 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f911a8a8
...@@ -372,7 +372,7 @@ class XMLMatrix(Folder): ...@@ -372,7 +372,7 @@ class XMLMatrix(Folder):
new_index = PersistentMapping() # new_index defines the relation new_index = PersistentMapping() # new_index defines the relation
# between keys and ids of cells # between keys and ids of cells
if not hasattr(self, 'index'): if getattr(self, 'index', None) is None:
self.index = PersistentMapping() self.index = PersistentMapping()
# Return if previous range is the same # Return if previous range is the same
...@@ -406,6 +406,7 @@ class XMLMatrix(Folder): ...@@ -406,6 +406,7 @@ class XMLMatrix(Folder):
if index_list[i] >= size_list[i]: if index_list[i] >= size_list[i]:
removed_cell_id_list.append(cell_id) removed_cell_id_list.append(cell_id)
break break
for cell_id in removed_cell_id_list: for cell_id in removed_cell_id_list:
self._delObject(cell_id) self._delObject(cell_id)
cell_id_list.remove(cell_id) cell_id_list.remove(cell_id)
......
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