Skip to content

Commit

Permalink
Remove Python < 3.5 selectors fallbacks (#81872)
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Oct 11, 2023
1 parent 46623b0 commit d2ba76c
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 714 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +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/>.

# 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.
'''
from __future__ import annotations

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',
)
3 changes: 1 addition & 2 deletions lib/ansible/module_utils/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import platform
import re
import select
import selectors
import shlex
import shutil
import signal
Expand Down Expand Up @@ -72,8 +73,6 @@
# Python2 & 3 way to get NoneType
NoneType = type(None)

from ansible.module_utils.compat import selectors

from ._text import to_native, to_bytes, to_text
from ansible.module_utils.common.text.converters import (
jsonify,
Expand Down
Loading

0 comments on commit d2ba76c

Please sign in to comment.