Skip to content

Commit

Permalink
Correctly index the entry points object.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehpor committed Oct 16, 2024
1 parent c401c75 commit abc8584
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions catkit2/testbed/service_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ def get_service_interface(cls, interface_name):
if interface_name is None:
return ServiceProxy

entry_point = importlib_metadata.entry_points(group='catkit2.proxies', name=interface_name)
entry_points = importlib_metadata.entry_points(group='catkit2.proxies')

if not entry_point:
if interface_name not in entry_points:
raise AttributeError(f"Service proxy class with interface name '{interface_name}' not found. Did you set it as an entry point?")

return entry_point[0].load()
return entry_points[interface_name].load()

0 comments on commit abc8584

Please sign in to comment.