From 1877565d4dc1582771d677954f40fe8e60bdc590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Tue, 2 Jun 2020 21:00:56 +0200 Subject: [PATCH] Stop to use the __future__ module. The __future__ module [1] was used in this context to ensure compatibility between python 2 and python 3. We previously dropped the support of python 2.7 [2] and now we only support python 3 so we don't need to continue to use this module and the imports listed below. Imports commonly used and their related PEPs: - `division` is related to PEP 238 [3] - `print_function` is related to PEP 3105 [4] - `unicode_literals` is related to PEP 3112 [5] - `with_statement` is related to PEP 343 [6] - `absolute_import` is related to PEP 328 [7] [1] https://docs.python.org/3/library/__future__.html [2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html [3] https://www.python.org/dev/peps/pep-0238 [4] https://www.python.org/dev/peps/pep-3105 [5] https://www.python.org/dev/peps/pep-3112 [6] https://www.python.org/dev/peps/pep-0343 [7] https://www.python.org/dev/peps/pep-0328 Change-Id: Ie7c18f2f1b6294e3d19c36112d35f4472ce77e7b --- taskflow/listeners/base.py | 2 -- taskflow/listeners/claims.py | 2 -- taskflow/listeners/logging.py | 2 -- taskflow/listeners/printing.py | 2 -- taskflow/listeners/timing.py | 2 -- taskflow/logging.py | 2 -- taskflow/persistence/backends/impl_sqlalchemy.py | 2 -- taskflow/persistence/backends/sqlalchemy/alembic/env.py | 2 -- taskflow/test.py | 2 -- 9 files changed, 18 deletions(-) diff --git a/taskflow/listeners/base.py b/taskflow/listeners/base.py index 4d2edf504..f5113a4e6 100644 --- a/taskflow/listeners/base.py +++ b/taskflow/listeners/base.py @@ -14,8 +14,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import - import abc from oslo_utils import excutils diff --git a/taskflow/listeners/claims.py b/taskflow/listeners/claims.py index ae8aabf06..dac74ce41 100644 --- a/taskflow/listeners/claims.py +++ b/taskflow/listeners/claims.py @@ -14,8 +14,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import - import logging import os diff --git a/taskflow/listeners/logging.py b/taskflow/listeners/logging.py index 6ea2ee10a..441a13ed0 100644 --- a/taskflow/listeners/logging.py +++ b/taskflow/listeners/logging.py @@ -14,8 +14,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import - import os from taskflow import formatters diff --git a/taskflow/listeners/printing.py b/taskflow/listeners/printing.py index 2a89b1794..8a690c3ca 100644 --- a/taskflow/listeners/printing.py +++ b/taskflow/listeners/printing.py @@ -14,8 +14,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import print_function - import sys import traceback diff --git a/taskflow/listeners/timing.py b/taskflow/listeners/timing.py index d8a731205..8634ee00a 100644 --- a/taskflow/listeners/timing.py +++ b/taskflow/listeners/timing.py @@ -14,8 +14,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import - import itertools import six import time diff --git a/taskflow/logging.py b/taskflow/logging.py index 849c99251..7c700f8b9 100644 --- a/taskflow/logging.py +++ b/taskflow/logging.py @@ -14,8 +14,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import - import logging _BASE = __name__.split(".", 1)[0] diff --git a/taskflow/persistence/backends/impl_sqlalchemy.py b/taskflow/persistence/backends/impl_sqlalchemy.py index 19b3b20b7..2dbe6ff32 100644 --- a/taskflow/persistence/backends/impl_sqlalchemy.py +++ b/taskflow/persistence/backends/impl_sqlalchemy.py @@ -15,8 +15,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import - import contextlib import copy import functools diff --git a/taskflow/persistence/backends/sqlalchemy/alembic/env.py b/taskflow/persistence/backends/sqlalchemy/alembic/env.py index 4e0a3ebf9..2094fe459 100644 --- a/taskflow/persistence/backends/sqlalchemy/alembic/env.py +++ b/taskflow/persistence/backends/sqlalchemy/alembic/env.py @@ -13,8 +13,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. - -from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool diff --git a/taskflow/test.py b/taskflow/test.py index ace97fc1c..2b1678df3 100644 --- a/taskflow/test.py +++ b/taskflow/test.py @@ -14,8 +14,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import - import collections import logging