From 2d3d9cb6594887d1b492ccd248c9a650a7660d69 Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Wed, 5 Feb 2020 15:34:47 -0800 Subject: [PATCH] fallback to old-style python interpreter default if running ansible < 2.8.0 --- ansible_mitogen/transport_config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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