Skip to content

Commit

Permalink
Oops.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacemanPaul authored and omad committed Feb 28, 2024
1 parent e5355d8 commit 125c87e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions datacube/drivers/driver_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,9 @@ def load_drivers(group: str) -> Dict[str, Any]:
"""

def safe_load(ep):
from pkg_resources import DistributionNotFound
# pylint: disable=broad-except,bare-except
try:
driver_init = ep.load()
except DistributionNotFound:
# This happens when entry points were marked with extra features,
# but extra feature were not requested for installation
return None
except Exception as e:
_LOG.warning('Failed to resolve driver %s::%s', group, ep.name)
_LOG.warning('Error was: %s', repr(e))
Expand All @@ -52,7 +47,7 @@ def safe_load(ep):

def resolve_all(group: str) -> Iterable[Tuple[str, Any]]:
from importlib_metadata import entry_points
for ep in entry_points(group=group, name=None):
for ep in entry_points(group=group):
driver = safe_load(ep)
if driver is not None:
yield (ep.name, driver)
Expand Down

0 comments on commit 125c87e

Please sign in to comment.