[Python-checkins] cpython (2.7): Issue #15560: Fix building _sqlite3 extension on OS X with an SDK.

ned.deily python-checkins at python.org
Mon Aug 6 00:17:38 CEST 2012


http://hg.python.org/cpython/rev/ef6c6d8adcf5
changeset:   78442:ef6c6d8adcf5
branch:      2.7
parent:      78424:322da186cced
user:        Ned Deily <nad at acm.org>
date:        Sun Aug 05 14:42:45 2012 -0700
summary:
  Issue #15560: Fix building _sqlite3 extension on OS X with an SDK.

files:
  Misc/NEWS |   2 ++
  setup.py  |  10 +++++-----
  2 files changed, 7 insertions(+), 5 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -327,6 +327,8 @@
 Build
 -----
 
+- Issue #15560: Fix building _sqlite3 extension on OS X with an SDK.
+
 - Issue #8847: Disable COMDAT folding in Windows PGO builds.
 
 - Issue #14018: Fix OS X Tcl/Tk framework checking when using OS X SDKs.
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1028,12 +1028,12 @@
         if sys.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 sys.platform == 'darwin' and is_macosx_sdk_path(d):
+                d = os.path.join(sysroot, d[1:])
+
             f = os.path.join(d, "sqlite3.h")
-
-            if sys.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
                 incf = open(f).read()

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list