summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGinnis <sean.mcginnis@gmail.com>2020-05-01 11:25:29 -0500
committerSean McGinnis <sean.mcginnis@gmail.com>2020-05-01 11:25:29 -0500
commitba93ce2486b75a2ae3d920cbbed28ddc1de6396b (patch)
treecb44592ca1244916b4cdb5412882340e57a22937
parent428585eb8f603fa09832cf725ff5a9ddba9e7ed4 (diff)
downloadtaskflow-ba93ce2486b75a2ae3d920cbbed28ddc1de6396b.tar.gz
Import modules, not classes
This addresses comments from I24b13c8654a33d99bf687a44a36cfdace39e3866 to follow guidelines to only import modules, not classes. Change-Id: I0e66c08bfcdff306bac0121602d45b56cfb2c712 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
-rw-r--r--taskflow/conductors/backends/impl_executor.py8
-rw-r--r--taskflow/types/sets.py5
2 files changed, 4 insertions, 9 deletions
diff --git a/taskflow/conductors/backends/impl_executor.py b/taskflow/conductors/backends/impl_executor.py
index 99c3e5e..ab55821 100644
--- a/taskflow/conductors/backends/impl_executor.py
+++ b/taskflow/conductors/backends/impl_executor.py
@@ -13,15 +13,11 @@
# under the License.
import abc
+import contextlib
import functools
import itertools
import threading
-try:
- from contextlib import ExitStack # noqa
-except ImportError:
- from contextlib2 import ExitStack # noqa
-
from oslo_utils import excutils
from oslo_utils import timeutils
import six
@@ -154,7 +150,7 @@ class ExecutorConductor(base.Conductor):
def _dispatch_job(self, job):
engine = self._engine_from_job(job)
listeners = self._listeners_from_job(job, engine)
- with ExitStack() as stack:
+ with contextlib.ExitStack() as stack:
for listener in listeners:
stack.enter_context(listener)
self._log.debug("Dispatching engine for job '%s'", job)
diff --git a/taskflow/types/sets.py b/taskflow/types/sets.py
index bbd988d..1a33ed3 100644
--- a/taskflow/types/sets.py
+++ b/taskflow/types/sets.py
@@ -15,8 +15,7 @@
# under the License.
import collections
-from collections.abc import Hashable
-from collections.abc import Set
+from collections import abc
import itertools
import six
@@ -34,7 +33,7 @@ def _merge_in(target, iterable=None, sentinel=_sentinel):
return target
-class OrderedSet(Set, Hashable):
+class OrderedSet(abc.Set, abc.Hashable):
"""A read-only hashable set that retains insertion/initial ordering.
It should work in all existing places that ``frozenset`` is used.