3
0
Fork 0

fix: avoid log warning if same entry point is found multiple times

kind of an edge case and maybe only relevant to python 3.8
This commit is contained in:
Lance Edgar 2026-03-21 11:52:19 -05:00
parent 197e836958
commit bba5faf629

View file

@ -168,6 +168,12 @@ def load_entry_points(group, lists=False, ignore_errors=False):
entry_points.setdefault(entry_point.name, []).append(ep)
else:
if entry_point.name in entry_points:
# TODO: not sure why the "same" entry point can be
# discovered multiple times, but in practice i did
# see this. however it was on a python 3.8 system
# so i'm guessing that has something to do with
# it. we'll avoid the warning if that's the case.
if entry_points[entry_point.name] is not ep:
log.warning(
"overwriting existing key '%s' with entry point: %s",
entry_point.name,