From: Georg Brandl Date: Tue, 13 Mar 2007 10:19:35 +0000 (+0000) Subject: Patch #1569798: fix a bug in distutils when building Python from a X-Git-Tag: v2.5.1c1~50 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=74fb2114455e73bc4ce9c384ee599db24ba95b3f;p=python Patch #1569798: fix a bug in distutils when building Python from a directory within sys.exec_prefix. (backport from rev. 54331) --- diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index 542b77a7ad..82474de823 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -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: diff --git a/Misc/NEWS b/Misc/NEWS index b993ad89ea..3a5edc0a8b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -384,6 +384,9 @@ Tests 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.