bpo-36146: Fix inc_dirs in setup.py on macOS (GH-12098) · python/cpython@96d8158 (original) (raw)

Original file line number Diff line number Diff line change
@@ -2003,16 +2003,17 @@ def detect_ctypes(self, inc_dirs, lib_dirs):
2003 2003 libraries=['m'])
2004 2004 self.extensions.extend([ext, ext_test])
2005 2005
2006 +ffi_inc_dirs = inc_dirs.copy()
2006 2007 if MACOS:
2007 2008 if '--with-system-ffi' not in sysconfig.get_config_var("CONFIG_ARGS"):
2008 2009 return
2009 2010 # OS X 10.5 comes with libffi.dylib; the include files are
2010 2011 # in /usr/include/ffi
2011 -inc_dirs.append('/usr/include/ffi')
2012 +ffi_inc_dirs.append('/usr/include/ffi')
2012 2013
2013 2014 ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
2014 2015 if not ffi_inc or ffi_inc[0] == '':
2015 -ffi_inc = find_file('ffi.h', [], inc_dirs)
2016 +ffi_inc = find_file('ffi.h', [], ffi_inc_dirs)
2016 2017 if ffi_inc is not None:
2017 2018 ffi_h = ffi_inc[0] + '/ffi.h'
2018 2019 if not os.path.exists(ffi_h):