]> granicus.if.org Git - python/commitdiff
Patch #1569798: fix a bug in distutils when building Python from a
authorGeorg Brandl <georg@python.org>
Tue, 13 Mar 2007 10:19:22 +0000 (10:19 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 13 Mar 2007 10:19:22 +0000 (10:19 +0000)
directory within sys.exec_prefix.

Lib/distutils/command/build_ext.py
Misc/NEWS

index 542b77a7ad827a7f93d6a6e6f948bb70256eb90d..82474de82307226aad55f914cc2b5d93735acb0d 100644 (file)
@@ -186,7 +186,7 @@ class build_ext (Command):
         # for extensions under Cygwin and AtheOS Python's library directory must be
         # appended to library_dirs
         if sys.platform[:6] == 'cygwin' or sys.platform[:6] == 'atheos':
-            if string.find(sys.executable, sys.exec_prefix) != -1:
+            if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
                 # building third party extensions
                 self.library_dirs.append(os.path.join(sys.prefix, "lib",
                                                       "python" + get_python_version(),
@@ -199,7 +199,7 @@ class build_ext (Command):
         # Python's library directory must be appended to library_dirs
         if (sys.platform.startswith('linux') or sys.platform.startswith('gnu')) \
                 and sysconfig.get_config_var('Py_ENABLE_SHARED'):
-            if string.find(sys.executable, sys.exec_prefix) != -1:
+            if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
                 # building third party extensions
                 self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
             else:
index 605d9b5d5cf1534221e1d2a486dcce1163dfff63..fa17fb924967670c1693cba634770e03e43b083c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -646,6 +646,9 @@ Tools/Demos
 Build
 -----
 
+- Patch #1569798: fix a bug in distutils when building Python from a
+  directory within sys.exec_prefix.
+
 - Bug #1675511: Use -Kpic instead of -xcode=pic32 on Solaris/x86.
 
 - Disable _XOPEN_SOURCE on NetBSD 1.x.