Skip to content

Commit

Permalink
Fix test failure with built library (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastic authored Oct 17, 2023
1 parent 2da6f25 commit 19ee0ac
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions rtree/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,15 @@ def load() -> ctypes.CDLL:
# add path for binary wheel prepared with cibuildwheel/auditwheel
try:
pkg_files = importlib.metadata.files("rtree")
for file in pkg_files: # type: ignore
if (
file.parent.name == "Rtree.libs"
and file.stem.startswith("libspatialindex")
and ".so" in file.suffixes
):
_candidates.insert(1, os.path.join(str(file.locate())))
break
if pkg_files is not None:
for file in pkg_files: # type: ignore
if (
file.parent.name == "Rtree.libs"
and file.stem.startswith("libspatialindex")
and ".so" in file.suffixes
):
_candidates.insert(1, os.path.join(str(file.locate())))
break
except importlib.metadata.PackageNotFoundError:
pass

Expand Down

0 comments on commit 19ee0ac

Please sign in to comment.