[Erp5-report] r29140 - /erp5/trunk/products/ERP5/Document/SimulationMovement.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Sep 22 17:49:26 CEST 2009


Author: jm
Date: Tue Sep 22 17:49:24 2009
New Revision: 29140

URL: http://svn.erp5.org?rev=29140&view=rev
Log:
Do not modify a container while iterating on it

objectValues does not always return a list. When it is called without any
parameter, a LazyMap object is returned and objects must not be deleted while
iterating on it: otherwise, objectValues may not return all objects.

Modified:
    erp5/trunk/products/ERP5/Document/SimulationMovement.py

Modified: erp5/trunk/products/ERP5/Document/SimulationMovement.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/SimulationMovement.py?rev=29140&r1=29139&r2=29140&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/SimulationMovement.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/SimulationMovement.py [utf8] Tue Sep 22 17:49:24 2009
@@ -266,7 +266,7 @@
       if ref and ref not in applicable_rule_dict:
         applicable_rule_dict[ref] = rule
 
-    for applied_rule in self.objectValues():
+    for applied_rule in list(self.objectValues()):
       rule = applied_rule.getSpecialiseValue()
       if not applied_rule._isTreeDelivered() and not rule.test(self):
         self._delObject(applied_rule.getId())




More information about the Erp5-report mailing list