From 2844a38f7fc024fbc7c6c4ceee5edd20ab69bc3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Tue, 2 Jun 2020 20:20:37 +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: I2f9d2114b2c5eb66f241646f1896ea17a160e3f3 --- keystone/cmd/cli.py | 3 --- keystone/cmd/doctor/ldap.py | 2 -- keystone/identity/backends/ldap/core.py | 1 - keystone/oauth1/core.py | 2 -- keystone/server/flask/application.py | 2 -- keystone/tests/unit/core.py | 2 -- 6 files changed, 12 deletions(-) diff --git a/keystone/cmd/cli.py b/keystone/cmd/cli.py index acfffa3449..6cd10cfb60 100644 --- a/keystone/cmd/cli.py +++ b/keystone/cmd/cli.py @@ -12,9 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import -from __future__ import print_function - import argparse import datetime import os diff --git a/keystone/cmd/doctor/ldap.py b/keystone/cmd/doctor/ldap.py index 96e006840f..cc1bd8a706 100644 --- a/keystone/cmd/doctor/ldap.py +++ b/keystone/cmd/doctor/ldap.py @@ -10,8 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import print_function - import os import re diff --git a/keystone/identity/backends/ldap/core.py b/keystone/identity/backends/ldap/core.py index d1cf7608a3..07f037a408 100644 --- a/keystone/identity/backends/ldap/core.py +++ b/keystone/identity/backends/ldap/core.py @@ -11,7 +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 absolute_import import uuid import ldap.filter diff --git a/keystone/oauth1/core.py b/keystone/oauth1/core.py index 68e208e2ad..dd8a4482a0 100644 --- a/keystone/oauth1/core.py +++ b/keystone/oauth1/core.py @@ -14,8 +14,6 @@ """Main entry point into the OAuth1 service.""" -from __future__ import absolute_import - import uuid import oauthlib.common diff --git a/keystone/server/flask/application.py b/keystone/server/flask/application.py index 286fd59455..12d59b2893 100644 --- a/keystone/server/flask/application.py +++ b/keystone/server/flask/application.py @@ -10,8 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import - import functools import sys diff --git a/keystone/tests/unit/core.py b/keystone/tests/unit/core.py index 0cb4627281..3c65bfbe69 100644 --- a/keystone/tests/unit/core.py +++ b/keystone/tests/unit/core.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 absolute_import import atexit import base64 import contextlib