diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-10-06 19:17:44 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-10-06 19:17:44 +0000 |
commit | 1caaecc5d6b2aa4cde4a50e31d1d993fce7a66c4 (patch) | |
tree | a660224270a74a467b5c06357904504ecbb7c39a /taskflow/utils/misc.py | |
parent | 221391f1d8713329b59e485902f15d7e03b86f92 (diff) | |
parent | 27badfc314d31c6932993b117e3c12d9eb7f064f (diff) | |
download | taskflow-1caaecc5d6b2aa4cde4a50e31d1d993fce7a66c4.tar.gz |
Merge "Avoid usage of six.moves in local functions"0.5.0
Diffstat (limited to 'taskflow/utils/misc.py')
-rw-r--r-- | taskflow/utils/misc.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/taskflow/utils/misc.py b/taskflow/utils/misc.py index 74c2752..d05e68d 100644 --- a/taskflow/utils/misc.py +++ b/taskflow/utils/misc.py @@ -34,6 +34,8 @@ import traceback from oslo.serialization import jsonutils from oslo.utils import netutils import six +from six.moves import map as compat_map +from six.moves import range as compat_range from six.moves.urllib import parse as urlparse from taskflow import exceptions as exc @@ -286,7 +288,7 @@ def item_from(container, index, name=None): def get_duplicate_keys(iterable, key=None): if key is not None: - iterable = six.moves.map(key, iterable) + iterable = compat_map(key, iterable) keys = set() duplicates = set() for item in iterable: @@ -373,7 +375,7 @@ class ExponentialBackoff(object): def __iter__(self): if self.count <= 0: raise StopIteration() - for i in six.moves.range(0, self.count): + for i in compat_range(0, self.count): yield min(self.exponent ** i, self.max_backoff) def __str__(self): |