--- a/dataimport/pgstore.py Tue Sep 15 15:07:13 2015 +0200
+++ b/dataimport/pgstore.py Tue Sep 15 16:56:57 2015 +0200
@@ -27,7 +27,7 @@
from collections import defaultdict
from base64 import b64encode
-from six.moves import cPickle as pickle
+from six.moves import cPickle as pickle, range
from cubicweb.utils import make_uid
from cubicweb.server.sqlutils import SQL_PREFIX
@@ -42,7 +42,7 @@
try:
chunksize = (len(statements) / nb_threads) + 1
threads = []
- for i in xrange(nb_threads):
+ for i in range(nb_threads):
chunks = statements[i*chunksize:(i+1)*chunksize]
thread = threading.Thread(target=_execmany_thread,
args=(sql_connect, chunks,
@@ -186,7 +186,7 @@
rows = []
if columns is None:
if isinstance(data[0], (tuple, list)):
- columns = range(len(data[0]))
+ columns = list(range(len(data[0])))
elif isinstance(data[0], dict):
columns = data[0].keys()
else: