diff src/memory/params.py @ 1050:de415d7984f7

memory (params), test: fixes bug relative to parameter filtering
author souliane <souliane@mailoo.org>
date Tue, 03 Jun 2014 15:10:51 +0200
parents 85c110c0be86
children 854880a31717
line wrap: on
line diff
--- a/src/memory/params.py	Wed Jun 04 12:57:49 2014 +0200
+++ b/src/memory/params.py	Tue Jun 03 15:10:51 2014 +0200
@@ -546,13 +546,16 @@
                     if category not in cache:
                         # we make a copy for the new xml
                         cache[category] = dest_cat = cat_node.cloneNode(True)
+                        to_remove = []
                         for node in dest_cat.childNodes:
                             if node.nodeName != "param":
                                 continue
                             if not checkNode(node):
-                                dest_cat.removeChild(node)
+                                to_remove.append(node)
                                 continue
                             dest_params[node.getAttribute('name')] = node
+                        for node in to_remove:
+                            dest_cat.removeChild(node)
                         new_node = True
                     else:
                         # It's not a new node, we use the previously cloned one