summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWouter Bolsterlee <uws@xs4all.nl>2016-03-20 22:07:11 +0100
committerWouter Bolsterlee <wouter@bolsterl.ee>2016-07-27 19:08:46 +0200
commita8cf18312b966bc5932f34b6463e7fba45d402c7 (patch)
tree27abbd3151268b9ad6337ff0f7157ceb143a2c64
parentc67ceaab04bd197f2d37598dbfa92eba144a6cee (diff)
downloadhappybase-a8cf18312b966bc5932f34b6463e7fba45d402c7.tar.gz
Use range() instead of xrange()
-rw-r--r--happybase/pool.py4
-rw-r--r--happybase/util.py4
2 files changed, 5 insertions, 3 deletions
diff --git a/happybase/pool.py b/happybase/pool.py
index 1ffff5a..2d6fee2 100644
--- a/happybase/pool.py
+++ b/happybase/pool.py
@@ -7,7 +7,7 @@ import logging
import socket
import threading
-from six.moves import queue
+from six.moves import queue, range
from thriftpy.thrift import TException
@@ -68,7 +68,7 @@ class ConnectionPool(object):
connection_kwargs = kwargs
connection_kwargs['autoconnect'] = False
- for i in xrange(size):
+ for i in range(size):
connection = Connection(**connection_kwargs)
self._queue.put(connection)
diff --git a/happybase/util.py b/happybase/util.py
index 09a4c61..99141f3 100644
--- a/happybase/util.py
+++ b/happybase/util.py
@@ -6,6 +6,8 @@ These functions are not part of the public API.
import re
+from six.moves import range
+
CAPITALS = re.compile('([A-Z])')
@@ -64,7 +66,7 @@ def str_increment(s):
drops everything after it. If the string only contains ``0xFF`` bytes,
`None` is returned.
"""
- for i in xrange(len(s) - 1, -1, -1):
+ for i in range(len(s) - 1, -1, -1):
if s[i] != '\xff':
return s[:i] + chr(ord(s[i]) + 1)