From 53f9822e75bab4112b6ca3f7e7cb5437cd5c199b Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 29 May 2020 21:37:52 +0200 Subject: [PATCH] make plugins loader Python 3.5 compatible again (#69754) ModuleNotFoundError was only introduced in Python 3.6 --- lib/ansible/plugins/loader.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ansible/plugins/loader.py b/lib/ansible/plugins/loader.py index 056ff44284a..1c4139329bf 100644 --- a/lib/ansible/plugins/loader.py +++ b/lib/ansible/plugins/loader.py @@ -49,6 +49,11 @@ try: imp = None except ImportError: import imp + +try: + ModuleNotFoundError +except NameError: + # this was introduced in Python 3.6 ModuleNotFoundError = None display = Display()