[devtools] fix sorting in ExecutionPlan._check_permissions on python3
authorJulien Cristau <julien.cristau@logilab.fr>
Tue, 29 Mar 2016 16:56:59 +0200
changeset 11226 6b0807ba056a
parent 11225 0f8301ea653b
child 11227 1c7ce09d2a36
[devtools] fix sorting in ExecutionPlan._check_permissions on python3 Sort lists instead of dict_items objects to get predictable results. With this change, unittest_querier.UtilsTC.test_preprocess_security passes every time instead of once in a blue moon. Closes #11759133.
cubicweb/devtools/repotest.py
--- a/cubicweb/devtools/repotest.py	Mon Mar 21 13:55:29 2016 +0100
+++ b/cubicweb/devtools/repotest.py	Tue Mar 29 16:56:59 2016 +0200
@@ -325,7 +325,7 @@
 
 def _check_permissions(*args, **kwargs):
     res, restricted = _orig_check_permissions(*args, **kwargs)
-    res = DumbOrderedDict(sorted(res.items(), key=lambda x: [y.items() for y in x[1]]))
+    res = DumbOrderedDict(sorted(res.items(), key=lambda x: [list(y.items()) for y in x[1]]))
     return res, restricted
 
 def _dummy_check_permissions(self, rqlst):