Skip to content

Commit

Permalink
use importlib-metadata < 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
endremborza committed Mar 10, 2021
1 parent 3c6e61c commit 69f63fb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions fsspec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@
]

if entry_points is not None:
entry_points = entry_points()
for spec in entry_points.get("fsspec.specs", []):
err_msg = f"Unable to load filesystem from {spec}"
register_implementation(spec.name, spec.value.replace(":", "."), errtxt=err_msg)
try:
entry_points = entry_points()
except TypeError:
pass # importlib-metadata < 0.8
else:
for spec in entry_points.get("fsspec.specs", []):
err_msg = f"Unable to load filesystem from {spec}"
register_implementation(spec.name, spec.value.replace(":", "."), errtxt=err_msg)

0 comments on commit 69f63fb

Please sign in to comment.