Skip to content

Commit

Permalink
Handle deprecation of importlib SelectableGroups dict interface
Browse files Browse the repository at this point in the history
  • Loading branch information
brechtm committed Dec 13, 2021
1 parent 28545fd commit 7bbf2af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Fixed:
styled (now mapped to the *menu cascade style*).
* Typos in code and documentation (PR #277 by Tim Gates, PR #281 by Filipe
Tavares)
* Handle deprecation of importlib SelectableGroups dict interface (Python 3.10
and importlib_metadata 3.6)


Release 0.5.3 (2021-06-16)
Expand Down
6 changes: 5 additions & 1 deletion src/rinoh/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ def parse_string(cls, resource_name, source):

@class_property
def installed_resources(cls):
for entry_point in ilm.entry_points()[cls.entry_point_group]:
try: # Python >= 3.10 and importlib_metadata >= 3.6
entry_points = ilm.entry_points(group=cls.entry_point_group)
except TypeError:
entry_points = ilm.entry_points()[cls.entry_point_group]
for entry_point in entry_points:
yield entry_point.name, entry_point

@classmethod
Expand Down

0 comments on commit 7bbf2af

Please sign in to comment.