Skip to content

Support packages that are using the new importlib.metadata api #808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bpython/curtsiesfrontend/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,16 @@ def __init__(self, watcher, old_meta_path):
self.watcher = watcher
self.old_meta_path = old_meta_path

def find_distributions(self, context):
for finder in self.old_meta_path:
distribution_finder = getattr(finder, 'find_distributions', None)
if distribution_finder is not None:
loader = finder.find_distributions(context)
if loader is not None:
return loader

return None

def find_module(self, fullname, path=None):
for finder in self.old_meta_path:
loader = finder.find_module(fullname, path)
Expand Down