@@ -105,12 +105,9 @@ def finalize_options (self):
105105
106106
107107 # Make sure Python's include directories (for Python.h, config.h,
108- # etc.) are in the include search path. We have to roll our own
109- # "exec include dir", because the Makefile parsed by sysconfig
110- # doesn't have it (sigh).
111- py_include = sysconfig .INCLUDEPY # prefix + "include" + "python" + ver
112- exec_py_include = os .path .join (sysconfig .exec_prefix , 'include' ,
113- 'python' + sys .version [0 :3 ])
108+ # etc.) are in the include search path.
109+ py_include = sysconfig .get_python_inc ()
110+ plat_py_include = sysconfig .get_python_inc (plat_specific = 1 )
114111 if self .include_dirs is None :
115112 self .include_dirs = self .distribution .include_dirs or []
116113 if type (self .include_dirs ) is StringType :
@@ -120,8 +117,8 @@ def finalize_options (self):
120117 # Put the Python "system" include dir at the end, so that
121118 # any local include dirs take precedence.
122119 self .include_dirs .append (py_include )
123- if exec_py_include != py_include :
124- self .include_dirs .insert ( 0 , exec_py_include )
120+ if plat_py_include != py_include :
121+ self .include_dirs .append ( plat_py_include )
125122
126123 if type (self .libraries ) is StringType :
127124 self .libraries = [self .libraries ]
0 commit comments