diff setup.py @ 78443:ee0ac9a0461f 3.2

Issue #15560: Fix building _sqlite3 extension on OS X with an SDK.
author Ned Deily <nad@acm.org>
date Sun, 05 Aug 2012 14:56:21 -0700
parents eb0af7f6ea6d
children 048e13546a7c d706a6f4724c
line wrap: on
line diff
--- a/setup.py	Sun Aug 05 14:52:45 2012 +0200
+++ b/setup.py	Sun Aug 05 14:56:21 2012 -0700
@@ -981,12 +981,12 @@
         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):
+                d = os.path.join(sysroot, d[1:])
 
-            if sys.platform == 'darwin' and is_macosx_sdk_path(d):
-                f = os.path.join(sysroot, d[1:], "sqlite3.h")
-
+            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: