[py3k] Import range from six.moves
authorRémi Cardona <remi.cardona@free.fr>
Wed, 23 Jul 2014 09:27:19 +0200
changeset 747 3d80ee7bd789
parent 746 2c51ddf1fce5
child 748 c97f90cd49c5
[py3k] Import range from six.moves
compare.py
rqlgen.py
stmts.py
test/unittest_utils.py
--- a/compare.py	Sun Jul 20 13:00:53 2014 +0200
+++ b/compare.py	Wed Jul 23 09:27:19 2014 +0200
@@ -21,6 +21,8 @@
 __docformat__ = "restructuredtext en"
 
 
+from six.moves import range
+
 from rql.nodes import VariableRef, Variable, Function, Relation, Comparison
 
 def compare_tree(request1, request2):
--- a/rqlgen.py	Sun Jul 20 13:00:53 2014 +0200
+++ b/rqlgen.py	Wed Jul 23 09:27:19 2014 +0200
@@ -20,6 +20,8 @@
 """
 __docformat__ = "restructuredtext en"
 
+from six.moves import range
+
 NOT = 1
 
 class RQLGenerator(object):
--- a/stmts.py	Sun Jul 20 13:00:53 2014 +0200
+++ b/stmts.py	Wed Jul 23 09:27:19 2014 +0200
@@ -26,6 +26,8 @@
 from copy import deepcopy
 from warnings import warn
 
+from six.moves import range
+
 from logilab.common.decorators import cached
 from logilab.common.deprecation import deprecated
 
@@ -206,7 +208,7 @@
             self.remove_select(select)
         newselect = Select()
         aliases = [nodes.VariableRef(newselect.make_variable())
-                   for i in xrange(len(select.selection))]
+                   for i in range(len(select.selection))]
         newselect.add_subquery(nodes.SubQuery(aliases, child), check=False)
         for vref in aliases:
             newselect.append_selected(nodes.VariableRef(vref.variable))
--- a/test/unittest_utils.py	Sun Jul 20 13:00:53 2014 +0200
+++ b/test/unittest_utils.py	Wed Jul 23 09:27:19 2014 +0200
@@ -16,6 +16,8 @@
 # You should have received a copy of the GNU Lesser General Public License along
 # with rql. If not, see <http://www.gnu.org/licenses/>.
 
+from six.moves import range
+
 from logilab.common.testlib import TestCase, unittest_main
 
 from rql import utils, nodes, parse