From a8cf18312b966bc5932f34b6463e7fba45d402c7 Mon Sep 17 00:00:00 2001 From: Wouter Bolsterlee Date: Sun, 20 Mar 2016 22:07:11 +0100 Subject: [PATCH] Use range() instead of xrange() --- happybase/pool.py | 4 ++-- happybase/util.py | 4 +++- 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)