server/sources/rql2sql.py
changeset 10609 e2d8e81bfe68
parent 10522 1660a0fa4f43
child 10651 9ca33768473c
--- a/server/sources/rql2sql.py	Tue Sep 15 15:07:13 2015 +0200
+++ b/server/sources/rql2sql.py	Tue Sep 15 16:56:57 2015 +0200
@@ -52,6 +52,8 @@
 import threading
 from datetime import datetime, time
 
+from six.moves import range
+
 from logilab.common.date import utcdatetime, utctime
 from logilab.database import FunctionDescr, SQL_FUNCTIONS_REGISTRY
 
@@ -189,13 +191,13 @@
                 thisexistssols = [newsols[0]]
                 thisexistsvars = set()
                 existssols[var.scope] = thisexistssols, thisexistsvars
-            for i in xrange(len(newsols)-1, 0, -1):
+            for i in range(len(newsols)-1, 0, -1):
                 if vtype != newsols[i][vname]:
                     thisexistssols.append(newsols.pop(i))
                     thisexistsvars.add(vname)
         else:
             # remember unstable variables
-            for i in xrange(1, len(newsols)):
+            for i in range(1, len(newsols)):
                 if vtype != newsols[i][vname]:
                     unstable.add(vname)
     if invariants: