Skip to content

Commit

Permalink
master.PkgutilMethod: Skip module loaders that raise ValueError
Browse files Browse the repository at this point in the history
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')
```
  • Loading branch information
moreati committed Jul 24, 2022
1 parent e8ad12e commit ad4b686
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mitogen/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ad4b686

Please sign in to comment.