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,11 +168,17 @@ def load_entry_points(group, lists=False, ignore_errors=False):
entry_points.setdefault(entry_point.name, []).append(ep) entry_points.setdefault(entry_point.name, []).append(ep)
else: else:
if entry_point.name in entry_points: if entry_point.name in entry_points:
log.warning( # TODO: not sure why the "same" entry point can be
"overwriting existing key '%s' with entry point: %s", # discovered multiple times, but in practice i did
entry_point.name, # see this. however it was on a python 3.8 system
ep, # 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,
ep,
)
entry_points[entry_point.name] = ep entry_points[entry_point.name] = ep
return entry_points return entry_points