Skip to content

Commit

Permalink
updated use of entry_points according to importlib version >3.6.0 (#1…
Browse files Browse the repository at this point in the history
…1417)

* updated use of entry_points according to importlib version >3.6.0

* added backwards compatibility for importlib

* Update __init__.py

Co-authored-by: Richard Tibbles <richard@learningequality.org>

* use isInstance() for type

---------

Co-authored-by: Richard Tibbles <richard@learningequality.org>
  • Loading branch information
im-NL and rtibbles authored Oct 18, 2023
1 parent 16a9422 commit 8450b14
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kolibri/plugins/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,13 @@ def check_plugin_config_file_location(version):
def iterate_plugins():
# Use to dedupe plugins
plugin_ids = set()
for entry_point in entry_points().get("kolibri.plugins", []):
all_entry_points = entry_points()
eps = (
all_entry_points.get("kolibri.plugins", [])
if isinstance(all_entry_points, dict)
else all_entry_points.select(group="kolibri.plugins")
)
for entry_point in eps:
name = entry_point.name
if name not in plugin_ids:
plugin_ids.add(name)
Expand Down

0 comments on commit 8450b14

Please sign in to comment.