Skip to content

Commit

Permalink
Update entrypoint selection
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbourbeau committed Jun 19, 2021
1 parent 0c469bf commit 384b872
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fsspec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@

if entry_points is not None:
try:
entry_points = entry_points()
eps = entry_points()
except TypeError:
pass # importlib-metadata < 0.8
else:
for spec in entry_points.get("fsspec.specs", []):
if hasattr(eps, "select"): # Python 3.10+ / importlib_metadata >= 3.9.0
specs = eps.select(group="fsspec.specs")
else:
specs = eps.get("fsspec.specs", [])
for spec in specs:
err_msg = f"Unable to load filesystem from {spec}"
register_implementation(
spec.name, spec.value.replace(":", "."), errtxt=err_msg
Expand Down

0 comments on commit 384b872

Please sign in to comment.