Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 18c47f6

Browse files
committed
Patch #1569798: fix a bug in distutils when building Python from a
directory within sys.exec_prefix.
1 parent b6a8754 commit 18c47f6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Lib/distutils/command/build_ext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def finalize_options (self):
186186
# for extensions under Cygwin and AtheOS Python's library directory must be
187187
# appended to library_dirs
188188
if sys.platform[:6] == 'cygwin' or sys.platform[:6] == 'atheos':
189-
if string.find(sys.executable, sys.exec_prefix) != -1:
189+
if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
190190
# building third party extensions
191191
self.library_dirs.append(os.path.join(sys.prefix, "lib",
192192
"python" + get_python_version(),
@@ -199,7 +199,7 @@ def finalize_options (self):
199199
# Python's library directory must be appended to library_dirs
200200
if (sys.platform.startswith('linux') or sys.platform.startswith('gnu')) \
201201
and sysconfig.get_config_var('Py_ENABLE_SHARED'):
202-
if string.find(sys.executable, sys.exec_prefix) != -1:
202+
if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
203203
# building third party extensions
204204
self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
205205
else:

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,9 @@ Tools/Demos
646646
Build
647647
-----
648648

649+
- Patch #1569798: fix a bug in distutils when building Python from a
650+
directory within sys.exec_prefix.
651+
649652
- Bug #1675511: Use -Kpic instead of -xcode=pic32 on Solaris/x86.
650653

651654
- Disable _XOPEN_SOURCE on NetBSD 1.x.

0 commit comments

Comments
 (0)