diff --git a/product/ERP5/Document/MovementGroup.py b/product/ERP5/Document/MovementGroup.py
index db6fabe0efb5969bde141451be936eea62e990de..e6f22b109fcd43b3556c6fc30f47a4131ee779a3 100644
--- a/product/ERP5/Document/MovementGroup.py
+++ b/product/ERP5/Document/MovementGroup.py
@@ -78,4 +78,4 @@ class MovementGroup(XMLObject):
     # DO NOT OVERRIDE THIS METHOD. Override _separate() instead.
     return sorted([[sorted(x[0], key=lambda x: x.getId()), x[1]] \
                    for x in self._separate(movement_list)],
-                  lambda a,b: cmp(a[0][0].getId(), b[0][0].getId()))
+                  key=lambda x: x[0][0].getId())
diff --git a/product/ERP5Form/Extensions/Folder_viewSearchDialog.py b/product/ERP5Form/Extensions/Folder_viewSearchDialog.py
index 5a904cfebfa7ef23a33df3a5e3600b758a3c1691..30623175a364bf9d848f9c5e4a14dc29940e7d1c 100644
--- a/product/ERP5Form/Extensions/Folder_viewSearchDialog.py
+++ b/product/ERP5Form/Extensions/Folder_viewSearchDialog.py
@@ -290,7 +290,7 @@ def getSearchDialog(self, REQUEST=None):
           field_id='your_category_list'))
       items = [('', '')] + sorted([(translateString(x.title), x.id) for x
                          in workflow.states.objectValues()],
-                         lambda a, b: cmp(a[0], b[0]))
+                         key=lambda x: x[0])
       field._surcharged_edit(
               dict(title=translateString(workflow.title),
                    items=items,