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:
parent
197e836958
commit
bba5faf629
1 changed files with 11 additions and 5 deletions
|
|
@ -168,11 +168,17 @@ 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:
|
||||
log.warning(
|
||||
"overwriting existing key '%s' with entry point: %s",
|
||||
entry_point.name,
|
||||
ep,
|
||||
)
|
||||
# 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,
|
||||
ep,
|
||||
)
|
||||
entry_points[entry_point.name] = ep
|
||||
|
||||
return entry_points
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue