diff --git a/ansible_mitogen/transport_config.py b/ansible_mitogen/transport_config.py index 25b5d5d1..5d4d6689 100644 --- a/ansible_mitogen/transport_config.py +++ b/ansible_mitogen/transport_config.py @@ -65,10 +65,15 @@ import os import ansible.utils.shlex import ansible.constants as C -from ansible.executor.interpreter_discovery import discover_interpreter from ansible.module_utils.six import with_metaclass from ansible.utils.unsafe_proxy import AnsibleUnsafeText +# this was added in Ansible >= 2.8.0; fallback to the default interpreter if necessary +try: + from ansible.executor.interpreter_discovery import discover_interpreter +except ModuleNotFoundError: + discover_interpreter = lambda a,b,c,d: '/usr/bin/python' + import mitogen.core