From 46e6c86ed42bf3f93ea918e83ab186de18e4c3dd Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Wed, 1 May 2013 10:25:40 -0500 Subject: Use range rather than xrange Use range rather than xrange to improve python3 compatibiltiy. Change-Id: I5a4434bbd2e5d509f84c3aa668eea8e46262816f Signed-off-by: Chuck Short --- openstack/common/authutils.py | 2 +- openstack/common/db/sqlalchemy/utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'openstack/common') diff --git a/openstack/common/authutils.py b/openstack/common/authutils.py index 4614238..130f175 100644 --- a/openstack/common/authutils.py +++ b/openstack/common/authutils.py @@ -37,7 +37,7 @@ def auth_str_equal(provided, known): result = 0 p_len = len(provided) k_len = len(known) - for i in xrange(p_len): + for i in range(p_len): a = ord(provided[i]) if i < p_len else 0 b = ord(known[i]) if i < k_len else 0 result |= a ^ b diff --git a/openstack/common/db/sqlalchemy/utils.py b/openstack/common/db/sqlalchemy/utils.py index 31a22e0..e89ec10 100644 --- a/openstack/common/db/sqlalchemy/utils.py +++ b/openstack/common/db/sqlalchemy/utils.py @@ -105,9 +105,9 @@ def paginate_query(query, model, limit, sort_keys, marker=None, # Build up an array of sort criteria as in the docstring criteria_list = [] - for i in xrange(0, len(sort_keys)): + for i in range(0, len(sort_keys)): crit_attrs = [] - for j in xrange(0, i): + for j in range(0, i): model_attr = getattr(model, sort_keys[j]) crit_attrs.append((model_attr == marker_values[j])) -- cgit