Skip to content

Commit

Permalink
support.plugin: fix the abominable workaround for Python 3.10+.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Oct 4, 2023
1 parent 54edef0 commit 62e27d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions software/glasgow/support/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
# can be removed.
def _entry_points(*, group, name=None):
for distribution in importlib.metadata.distributions():
distribution.name = distribution.metadata["Name"]
if not hasattr(distribution, "name"):
distribution.name = distribution.metadata["Name"]
for entry_point in distribution.entry_points:
if entry_point.group == group and (name is None or entry_point.name == name):
entry_point.dist = distribution
if not hasattr(entry_point, "dist"):
entry_point.dist = distribution
yield entry_point


Expand Down

0 comments on commit 62e27d9

Please sign in to comment.