summaryrefslogtreecommitdiffstats
path: root/lib/ansible/compat
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ansible/compat')
-rw-r--r--lib/ansible/compat/__init__.py5
-rw-r--r--lib/ansible/compat/importlib_resources.py3
-rw-r--r--lib/ansible/compat/selectors.py (renamed from lib/ansible/compat/selectors/__init__.py)24
3 files changed, 14 insertions, 18 deletions
diff --git a/lib/ansible/compat/__init__.py b/lib/ansible/compat/__init__.py
index 2990c6f..9977603 100644
--- a/lib/ansible/compat/__init__.py
+++ b/lib/ansible/compat/__init__.py
@@ -15,12 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
-# Make coding more python3-ish
-from __future__ import (absolute_import, division, print_function)
-__metaclass__ = type
-
'''
Compat library for ansible. This contains compatibility definitions for older python
When we need to import a module differently depending on python version, do it
here. Then in the code we can simply import from compat in order to get what we want.
'''
+from __future__ import annotations
diff --git a/lib/ansible/compat/importlib_resources.py b/lib/ansible/compat/importlib_resources.py
index ed104d6..0df95f0 100644
--- a/lib/ansible/compat/importlib_resources.py
+++ b/lib/ansible/compat/importlib_resources.py
@@ -1,8 +1,7 @@
# Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
-from __future__ import (absolute_import, division, print_function)
-__metaclass__ = type
+from __future__ import annotations
import sys
diff --git a/lib/ansible/compat/selectors/__init__.py b/lib/ansible/compat/selectors.py
index a7b260e..0117f36 100644
--- a/lib/ansible/compat/selectors/__init__.py
+++ b/lib/ansible/compat/selectors.py
@@ -15,18 +15,18 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
-# Make coding more python3-ish
-from __future__ import (absolute_import, division, print_function)
-__metaclass__ = type
+from __future__ import annotations
-# NOT_BUNDLED
-
-'''
-Compat selectors library. Python-3.5 has this builtin. The selectors2
-package exists on pypi to backport the functionality as far as python-2.6.
-Implementation previously resided here - maintaining this file after the
-move to ansible.module_utils for code backwards compatibility.
-'''
import sys
-from ansible.module_utils.compat import selectors
+import selectors
+
+from ansible.module_utils.common.warnings import deprecate
+
+
sys.modules['ansible.compat.selectors'] = selectors
+
+
+deprecate(
+ msg='The `ansible.module_utils.compat.selectors` module is deprecated.',
+ version='2.19',
+)