From dfc684a24cfe13b8d446b21aff3507cb6c964db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Tue, 2 Jun 2020 21:08:18 +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: I88a05dfd99fbca043f25b5ddce7663467699e69b --- zaqar/bench/conductor.py | 2 -- zaqar/bench/consumer.py | 3 --- zaqar/bench/observer.py | 3 --- zaqar/bench/producer.py | 3 --- zaqar/common/cli.py | 2 -- zaqar/storage/mongodb/utils.py | 2 -- zaqar/storage/sqlalchemy/migration/alembic_migrations/env.py | 2 -- zaqar/tests/functional/wsgi/v1/test_messages.py | 2 -- zaqar/tests/functional/wsgi/v1_1/test_messages.py | 2 -- zaqar/tests/functional/wsgi/v2/test_subscriptions.py | 2 -- 10 files changed, 23 deletions(-) diff --git a/zaqar/bench/conductor.py b/zaqar/bench/conductor.py index fd1b84dc5..a10dd956e 100644 --- a/zaqar/bench/conductor.py +++ b/zaqar/bench/conductor.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import print_function - import json import multiprocessing as mp import os diff --git a/zaqar/bench/consumer.py b/zaqar/bench/consumer.py index 9479d1355..6f541cdc7 100644 --- a/zaqar/bench/consumer.py +++ b/zaqar/bench/consumer.py @@ -12,9 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import division -from __future__ import print_function - import multiprocessing as mp import random import sys diff --git a/zaqar/bench/observer.py b/zaqar/bench/observer.py index 861eacde4..bc8309960 100644 --- a/zaqar/bench/observer.py +++ b/zaqar/bench/observer.py @@ -12,9 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import division -from __future__ import print_function - import multiprocessing as mp import random import sys diff --git a/zaqar/bench/producer.py b/zaqar/bench/producer.py index 62c5998f7..9787faa97 100644 --- a/zaqar/bench/producer.py +++ b/zaqar/bench/producer.py @@ -12,9 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import division -from __future__ import print_function - import json import multiprocessing as mp import random diff --git a/zaqar/common/cli.py b/zaqar/common/cli.py index c72b25816..ed4125279 100644 --- a/zaqar/common/cli.py +++ b/zaqar/common/cli.py @@ -11,8 +11,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 print_function import functools import sys diff --git a/zaqar/storage/mongodb/utils.py b/zaqar/storage/mongodb/utils.py index 9a87a48f5..0af517e71 100644 --- a/zaqar/storage/mongodb/utils.py +++ b/zaqar/storage/mongodb/utils.py @@ -12,8 +12,6 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import division import binascii import collections import datetime diff --git a/zaqar/storage/sqlalchemy/migration/alembic_migrations/env.py b/zaqar/storage/sqlalchemy/migration/alembic_migrations/env.py index 7a667c26e..7a8b44e6e 100644 --- a/zaqar/storage/sqlalchemy/migration/alembic_migrations/env.py +++ b/zaqar/storage/sqlalchemy/migration/alembic_migrations/env.py @@ -14,8 +14,6 @@ # limitations under the License. # # Based on Neutron's migration/cli.py - -from __future__ import with_statement from logging import config as c from alembic import context diff --git a/zaqar/tests/functional/wsgi/v1/test_messages.py b/zaqar/tests/functional/wsgi/v1/test_messages.py index 4306b81e6..f10054046 100644 --- a/zaqar/tests/functional/wsgi/v1/test_messages.py +++ b/zaqar/tests/functional/wsgi/v1/test_messages.py @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import division - import json import uuid diff --git a/zaqar/tests/functional/wsgi/v1_1/test_messages.py b/zaqar/tests/functional/wsgi/v1_1/test_messages.py index ba89c4807..ebfcd8630 100644 --- a/zaqar/tests/functional/wsgi/v1_1/test_messages.py +++ b/zaqar/tests/functional/wsgi/v1_1/test_messages.py @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import division - import json import uuid diff --git a/zaqar/tests/functional/wsgi/v2/test_subscriptions.py b/zaqar/tests/functional/wsgi/v2/test_subscriptions.py index 185d0df02..28d7c5593 100644 --- a/zaqar/tests/functional/wsgi/v2/test_subscriptions.py +++ b/zaqar/tests/functional/wsgi/v2/test_subscriptions.py @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import division - import time import uuid