# HG changeset patch # Parent 5284e65e865b1737d3a1b74767d4716425f0bc79 Issue #15560: Fix building _sqlite3 extension on OS X with an SDK. diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -1041,12 +1041,12 @@ if host_platform == 'darwin': sysroot = macosx_sdk_root() - for d in inc_dirs + sqlite_inc_paths: + for d_ in inc_dirs + sqlite_inc_paths: + d = d_ + if host_platform == 'darwin' and is_macosx_sdk_path(d): + d = os.path.join(sysroot, d[1:]) + f = os.path.join(d, "sqlite3.h") - - if host_platform == 'darwin' and is_macosx_sdk_path(d): - f = os.path.join(sysroot, d[1:], "sqlite3.h") - if os.path.exists(f): if sqlite_setup_debug: print("sqlite: found %s"%f) with open(f) as file: