Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 98b91d2

Browse files
committed
Support finders such as those exposed by PyOxidizer that don't have an __module__ object. Closes #110.
1 parent 725935b commit 98b91d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

importlib_metadata/_compat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def disable_stdlib_finder():
7373
"""
7474
def matches(finder):
7575
return (
76-
finder.__module__ == '_frozen_importlib_external'
76+
getattr(finder, '__module__', None) == '_frozen_importlib_external'
7777
and hasattr(finder, 'find_distributions')
7878
)
7979
for finder in filter(matches, sys.meta_path): # pragma: nocover

0 commit comments

Comments
 (0)