From ad4b686836c2e1b8b8611fa5d467ad018ef75cf8 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Thu, 2 Jun 2022 23:44:38 +0100 Subject: [PATCH] master.PkgutilMethod: Skip module loaders that raise ValueError e.g. in Ansible 6, ansible-core 2.13 ``` [mux 2717] 23:39:11.342416 D mitogen: PkgutilMethod(): _AnsibleCollectionLoader(path=None).get_file_name('ansible.plugins') failed: ValueError('_AnsibleCollectionLoader(path=None) cannot find files for ansible.plugins, only ansible_collections.ansible.builtin.plugins') ``` --- mitogen/master.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mitogen/master.py b/mitogen/master.py index 3a163a8b0..4fb535f0a 100644 --- a/mitogen/master.py +++ b/mitogen/master.py @@ -536,7 +536,7 @@ def find(self, fullname): try: path = loader.get_filename(fullname) - except (AttributeError, ImportError): + except (AttributeError, ImportError, ValueError): # - get_filename() may throw ImportError if pkgutil.find_loader() # picks a "parent" package's loader for some crap that's been # stuffed in sys.modules, for example in the case of urllib3: