[devtools] pass a key to sort() method
authorJulien Cristau <julien.cristau@logilab.fr>
Mon, 19 Oct 2015 14:29:06 +0200
changeset 10804 ee113e1e03de
parent 10803 d261bd7c47cf
child 10805 de4403644b1c
[devtools] pass a key to sort() method python3 dicts are not comparable
devtools/repotest.py
--- a/devtools/repotest.py	Wed Oct 21 17:21:18 2015 +0200
+++ b/devtools/repotest.py	Mon Oct 19 14:29:06 2015 +0200
@@ -187,7 +187,7 @@
         plan = self.qhelper.plan_factory(union, {}, FakeSession(self.repo))
         plan.preprocess(union)
         for select in union.children:
-            select.solutions.sort()
+            select.solutions.sort(key=lambda x: list(x.items()))
         #print '********* ppsolutions', solutions
         return union
 
@@ -238,7 +238,7 @@
         if simplify:
             rqlhelper.simplify(rqlst)
         for select in rqlst.children:
-            select.solutions.sort()
+            select.solutions.sort(key=lambda x: list(x.items()))
         return self.o.plan_factory(rqlst, kwargs, cnx)
 
     def _prepare(self, cnx, rql, kwargs=None):
@@ -286,9 +286,9 @@
         if rqlst.TYPE == 'select':
             self.repo.vreg.rqlhelper.annotate(rqlst)
             for select in rqlst.children:
-                select.solutions.sort()
+                select.solutions.sort(key=lambda x: list(x.items()))
         else:
-            rqlst.solutions.sort()
+            rqlst.solutions.sort(key=lambda x: list(x.items()))
         return self.o.plan_factory(rqlst, kwargs, cnx)