From abc85848a9193e657b1ba237e35d4618abbef9b4 Mon Sep 17 00:00:00 2001 From: Emiel Por Date: Wed, 16 Oct 2024 13:32:02 -0700 Subject: [PATCH] Correctly index the entry points object. --- catkit2/testbed/service_proxy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/catkit2/testbed/service_proxy.py b/catkit2/testbed/service_proxy.py index 3df5626e..71481ddf 100644 --- a/catkit2/testbed/service_proxy.py +++ b/catkit2/testbed/service_proxy.py @@ -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()