From 1a92995a245e1decdda2cc1e0b2775a6a321eeec Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 30 May 2019 06:00:54 +0100 Subject: [PATCH] issue #590: include nasty workaround for sys.modules junk --- ansible_mitogen/runner.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ansible_mitogen/runner.py b/ansible_mitogen/runner.py index 30c36be7..a8dae8b1 100644 --- a/ansible_mitogen/runner.py +++ b/ansible_mitogen/runner.py @@ -760,7 +760,12 @@ class NewStyleRunner(ScriptRunner): for fullname, _, _ in self.module_map['custom']: mitogen.core.import_module(fullname) for fullname in self.module_map['builtin']: - mitogen.core.import_module(fullname) + try: + mitogen.core.import_module(fullname) + except ImportError: + # TODO: this is a huge hack to work around issue #590. + if fullname != 'ansible.module_utils.distro._distro': + raise def _setup_excepthook(self): """