server/rqlannotation.py
changeset 10669 155c29e0ed1c
parent 10663 54b8a1f249fb
--- a/server/rqlannotation.py	Tue Sep 15 17:10:58 2015 +0200
+++ b/server/rqlannotation.py	Fri Sep 18 14:29:53 2015 +0200
@@ -195,7 +195,7 @@
     # if DISTINCT query, can use variable from a different scope as principal
     # since introduced duplicates will be removed
     if scope.stmt.distinct and diffscope_rels:
-        return iter(_sort(diffscope_rels)).next()
+        return next(iter(_sort(diffscope_rels)))
     # XXX could use a relation from a different scope if it can't generate
     # duplicates, so we should have to check cardinality
     raise CantSelectPrincipal()