diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 23007e1689..974d47a55d 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -808,9 +808,12 @@ class Facts(object): }, 'version_info': list(sys.version_info), 'executable': sys.executable, - 'type': sys.subversion[0], 'has_sslcontext': HAS_SSLCONTEXT } + try: + self.facts['python']['type'] = sys.subversion[0] + except AttributeError: + self.facts['python']['type'] = None class Hardware(Facts):