Skip to content

Commit 40b4b50

Browse files
committed
Update get_pybind11_include
1 parent d2daeb2 commit 40b4b50

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pybind11/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@
44
def get_include(user=False):
55
import os
66
d = os.path.dirname(__file__)
7-
return os.path.join(os.path.dirname(d), "include")
7+
if os.path.exists(os.path.join(d, "include")):
8+
# Package is installed
9+
return os.path.join(d, "include")
10+
else:
11+
# Package is from a source directory
12+
return os.path.join(os.path.dirname(d), "include")

0 commit comments

Comments
 (0)