devtools/repotest.py
changeset 7359 40490b9e0a6e
parent 7358 5a56890b33df
parent 7357 5ad3154a8810
child 7398 26695dd703d8
--- a/devtools/repotest.py	Tue May 10 18:53:18 2011 +0200
+++ b/devtools/repotest.py	Tue May 10 18:53:30 2011 +0200
@@ -372,8 +372,13 @@
 _orig_select_principal = rqlannotation._select_principal
 
 def _select_principal(scope, relations):
+    def sort_key(something):
+        try:
+            return something.r_type
+        except AttributeError:
+            return (something[0].r_type, something[1])
     return _orig_select_principal(scope, relations,
-                                  _sort=lambda rels: sorted(rels, key=lambda x: x.r_type))
+                                  _sort=lambda rels: sorted(rels, key=sort_key))
 
 try:
     from cubicweb.server.msplanner import PartPlanInformation