diff --git a/src/wuttjamaican/util.py b/src/wuttjamaican/util.py index 2f7d846..296eec7 100644 --- a/src/wuttjamaican/util.py +++ b/src/wuttjamaican/util.py @@ -76,9 +76,16 @@ def load_entry_points(group, ignore_errors=False): entry_points[entry_point.name] = ep else: - # newer setup (python >= 3.8); can use importlib + # newer setup (python >= 3.8); can use importlib, but the + # details may vary eps = importlib.metadata.entry_points() - for entry_point in eps.select(group=group): + if isinstance(eps, dict): + # python < 3.10 + eps = eps.get(group, []) + else: + # python >= 3.10 + eps = eps.select(group=group) + for entry_point in eps: try: ep = entry_point.load() except: