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

Skip to content

Commit a606aef

Browse files
committed
Issue #15188: Modify the OS X build_installer script to remove temporary
build paths from configuration variables cached in _sysconfigdata.py, as is already done for the installed Makefile. This avoids a distuils test case failure in test_ldshared_value.
1 parent 7b31b1a commit a606aef

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

Mac/BuildScript/build-installer.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -900,19 +900,26 @@ def buildPython():
900900

901901
# We added some directories to the search path during the configure
902902
# phase. Remove those because those directories won't be there on
903-
# the end-users system.
904-
path =os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework',
905-
'Versions', version, 'lib', 'python%s'%(version,),
906-
'config' + config_suffix, 'Makefile')
907-
fp = open(path, 'r')
908-
data = fp.read()
909-
fp.close()
903+
# the end-users system. Also remove the directories from _sysconfigdata.py
904+
# (added in 3.3) if it exists.
905+
906+
path_to_lib = os.path.join(rootDir, 'Library', 'Frameworks',
907+
'Python.framework', 'Versions',
908+
version, 'lib', 'python%s'%(version,))
909+
paths = [os.path.join(path_to_lib, 'config' + config_suffix, 'Makefile'),
910+
os.path.join(path_to_lib, '_sysconfigdata.py')]
911+
for path in paths:
912+
if not os.path.exists(path):
913+
continue
914+
fp = open(path, 'r')
915+
data = fp.read()
916+
fp.close()
910917

911-
data = data.replace('-L%s/libraries/usr/local/lib'%(WORKDIR,), '')
912-
data = data.replace('-I%s/libraries/usr/local/include'%(WORKDIR,), '')
913-
fp = open(path, 'w')
914-
fp.write(data)
915-
fp.close()
918+
data = data.replace('-L%s/libraries/usr/local/lib'%(WORKDIR,), '')
919+
data = data.replace('-I%s/libraries/usr/local/include'%(WORKDIR,), '')
920+
fp = open(path, 'w')
921+
fp.write(data)
922+
fp.close()
916923

917924
# Add symlinks in /usr/local/bin, using relative links
918925
usr_local_bin = os.path.join(rootDir, 'usr', 'local', 'bin')

0 commit comments

Comments
 (0)