Skip to content

Commit

Permalink
SupportPy312: Work around ansible's import failures on 3.12
Browse files Browse the repository at this point in the history
Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
  • Loading branch information
gabe-l-hart committed Nov 21, 2023
1 parent 7a142e7 commit f5bc677
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
import logging.handlers
import pathlib

# COMPATIBILITY
# With >= 3.12, the vendored ansible six functionality does not import cleanly,
# so we patch sys.modules to work around this
import sys

if sys.version_info.major > 3 or sys.version_info.minor > 11:
# Third Party
from six import moves

sys.modules["ansible.module_utils.six.moves"] = moves

# Third Party
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.k8s.common import K8sAnsibleMixin
Expand Down

0 comments on commit f5bc677

Please sign in to comment.