devtools/fill.py
changeset 10609 e2d8e81bfe68
parent 10589 7c23b7de2b8d
child 10688 fa29f3628a1b
--- a/devtools/fill.py	Tue Sep 15 15:07:13 2015 +0200
+++ b/devtools/fill.py	Tue Sep 15 16:56:57 2015 +0200
@@ -27,6 +27,8 @@
 from datetime import datetime, date, time, timedelta
 from decimal import Decimal
 
+from six.moves import range
+
 from logilab.common import attrdict
 from logilab.mtconverter import xml_escape
 from yams.constraints import (SizeConstraint, StaticVocabularyConstraint,
@@ -287,7 +289,7 @@
                         returns acceptable values for this attribute
     """
     queries = []
-    for index in xrange(entity_num):
+    for index in range(entity_num):
         restrictions = []
         args = {}
         for attrname, value in make_entity(etype, schema, vreg, index, choice_func).items():
@@ -509,8 +511,8 @@
                     break
         else:
             # FIXME: 20 should be read from config
-            subjeidsiter = [choice(tuple(subjeids)) for i in xrange(min(len(subjeids), 20))]
-            objeidsiter = [choice(tuple(objeids)) for i in xrange(min(len(objeids), 20))]
+            subjeidsiter = [choice(tuple(subjeids)) for i in range(min(len(subjeids), 20))]
+            objeidsiter = [choice(tuple(objeids)) for i in range(min(len(objeids), 20))]
             for subjeid, objeid in zip(subjeidsiter, objeidsiter):
                 if subjeid != objeid and not (subjeid, objeid) in used:
                     used.add( (subjeid, objeid) )