File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -130,12 +130,20 @@ def get_python_inc(plat_specific=0, prefix=None):
130
130
return getter (resolved_prefix , prefix , plat_specific )
131
131
132
132
133
+ @pass_none
134
+ def _extant (path ):
135
+ """
136
+ Replace path with None if it doesn't exist.
137
+ """
138
+ return path if os .path .exists (path ) else None
139
+
140
+
133
141
def _get_python_inc_posix (prefix , spec_prefix , plat_specific ):
134
142
if IS_PYPY and sys .version_info < (3 , 8 ):
135
143
return os .path .join (prefix , 'include' )
136
144
return (
137
145
_get_python_inc_posix_python (plat_specific )
138
- or _get_python_inc_from_config (plat_specific , spec_prefix )
146
+ or _extant ( _get_python_inc_from_config (plat_specific , spec_prefix ) )
139
147
or _get_python_inc_posix_prefix (prefix )
140
148
)
141
149
You can’t perform that action at this time.
0 commit comments