Skip to content

Commit

Permalink
plugins.handlers: use dist name to look up EntryPointPlugin version
Browse files Browse the repository at this point in the history
  • Loading branch information
dgw authored and SnoopJ committed Oct 30, 2024
1 parent f29ccd3 commit a851652
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sopel/plugins/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,11 +620,11 @@ def get_version(self) -> Optional[str]:

if (
version is None
and hasattr(self.module, "__package__")
and self.module.__package__ is not None
and hasattr(self.entry_point, "dist")
and hasattr(self.entry_point.dist, "name")
):
try:
version = importlib.metadata.version(self.module.__package__)
version = importlib.metadata.version(self.entry_point.dist.name)
except Exception:
# fine, just give up
pass
Expand Down

0 comments on commit a851652

Please sign in to comment.