From d0d8e8a20573c7d7c16d82f9a4a2c36d132a4db1 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Sun, 27 Oct 2024 22:32:57 -0500 Subject: [PATCH] fix: workaround to support python 3.9 and older --- errbot/utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/errbot/utils.py b/errbot/utils.py index 7e54b92d7..2c1dff03e 100644 --- a/errbot/utils.py +++ b/errbot/utils.py @@ -202,7 +202,13 @@ def entry_point_plugins(group): paths = [] eps = importlib.metadata.entry_points() - for entry_point in eps.select(group=group): + try: + entry_points = eps.select(group=group) + except AttributeError: + # workaround to support python 3.9 and older + entry_points = eps.get(group, ()) + + for entry_point in entry_points: module_name = entry_point.module file_name = module_name.replace(".", "/") + ".py" for f in entry_point.dist.files: