Skip to content

Commit 8886485

Browse files
committed
Allow get_include to handle sdist installations
1 parent ab8a386 commit 8886485

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: rtree/core.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ def free_error_msg_ptr(result, func, cargs):
7575

7676
def get_include():
7777
import rtree
78-
79-
return os.path.join(os.path.dirname(rtree.__file__), "include")
78+
from importlib import resources
79+
include_dir = resources.files(rtree).joinpath('include')
80+
return str(include_dir) if include_dir.is_dir() else ''
8081

8182

8283
# load the shared library by looking in likely places

0 commit comments

Comments
 (0)