Issue #15560: Fix building _sqlite3 extension on OS X with an SDK.
authorNed Deily <nad@acm.org>
Sun, 5 Aug 2012 21:56:21 +0000 (14:56 -0700)
committerNed Deily <nad@acm.org>
Sun, 5 Aug 2012 21:56:21 +0000 (14:56 -0700)
Misc/NEWS
setup.py

index c431474a0fe7e9bf0adbc150ff9699a4bd5a61a4..ed4fa871c6aed402c68b91832725efa36a6889fa 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -440,6 +440,8 @@ Tests
 Build
 -----
 
+- Issue #15560: Fix building _sqlite3 extension on OS X with an SDK.
+
 - Issue #8847: Disable COMDAT folding in Windows PGO builds.
 
 - Issue #14197: For OS X framework builds, ensure links to the shared
index f3886bf437627bc47619ce74fd0bb671904327a0..65acb99f7c17187439641c28d60d1184b90a3280 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -981,12 +981,12 @@ class PyBuildExt(build_ext):
         if sys.platform == 'darwin':
             sysroot = macosx_sdk_root()
 
-        for d in inc_dirs + sqlite_inc_paths:
-            f = os.path.join(d, "sqlite3.h")
-
+        for d_ in inc_dirs + sqlite_inc_paths:
+            d = d_
             if sys.platform == 'darwin' and is_macosx_sdk_path(d):
-                f = os.path.join(sysroot, d[1:], "sqlite3.h")
+                d = os.path.join(sysroot, d[1:])
 
+            f = os.path.join(d, "sqlite3.h")
             if os.path.exists(f):
                 if sqlite_setup_debug: print("sqlite: found %s"%f)
                 with open(f) as file: