[Python-checkins] r54331 - in python/trunk: Lib/distutils/command/build_ext.py Misc/NEWS

georg.brandl python-checkins at python.org
Tue Mar 13 11:19:29 CET 2007


Author: georg.brandl
Date: Tue Mar 13 11:19:22 2007
New Revision: 54331

Modified:
   python/trunk/Lib/distutils/command/build_ext.py
   python/trunk/Misc/NEWS
Log:
Patch #1569798: fix a bug in distutils when building Python from a
directory within sys.exec_prefix.


Modified: python/trunk/Lib/distutils/command/build_ext.py
==============================================================================
--- python/trunk/Lib/distutils/command/build_ext.py	(original)
+++ python/trunk/Lib/distutils/command/build_ext.py	Tue Mar 13 11:19:22 2007
@@ -186,7 +186,7 @@
         # 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 @@
         # 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:

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Tue Mar 13 11:19:22 2007
@@ -646,6 +646,9 @@
 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.


More information about the Python-checkins mailing list