updated config file name for Python 3.6 (#2881)
This commit is contained in:
parent
19699a7607
commit
6bc7be9217
@ -148,6 +148,16 @@ def install(self, spec, prefix):
|
||||
make()
|
||||
make('install')
|
||||
|
||||
self.sysconfigfilename = '_sysconfigdata.py'
|
||||
if spec.satisfies('@3.6:'):
|
||||
# Python 3.6.0 renamed the sys config file
|
||||
python3 = os.path.join(prefix.bin,
|
||||
'python{0}'.format(self.version.up_to(1)))
|
||||
python = Executable(python3)
|
||||
sc = 'import sysconfig; print(sysconfig._get_sysconfigdata_name())'
|
||||
cf = python('-c', sc, output=str).strip('\n')
|
||||
self.sysconfigfilename = '{0}.py'.format(cf)
|
||||
|
||||
self._save_distutil_vars(prefix)
|
||||
|
||||
self.filter_compilers(prefix)
|
||||
@ -207,12 +217,11 @@ def _save_distutil_vars(self, prefix):
|
||||
input_filename = None
|
||||
for filename in [join_path(lib_dir,
|
||||
'python{0}'.format(self.version.up_to(2)),
|
||||
'_sysconfigdata.py')
|
||||
self.sysconfigfilename)
|
||||
for lib_dir in [prefix.lib, prefix.lib64]]:
|
||||
if os.path.isfile(filename):
|
||||
input_filename = filename
|
||||
break
|
||||
|
||||
if not input_filename:
|
||||
return
|
||||
|
||||
@ -301,7 +310,7 @@ def filter_compilers(self, prefix):
|
||||
config_dirname = 'config-{0}m'.format(
|
||||
self.version.up_to(2)) if self.spec.satisfies('@3:') else 'config'
|
||||
|
||||
rel_filenames = ['_sysconfigdata.py',
|
||||
rel_filenames = [self.sysconfigfilename,
|
||||
join_path(config_dirname, 'Makefile')]
|
||||
|
||||
abs_filenames = [join_path(dirname, filename) for dirname in
|
||||
|
Loading…
Reference in New Issue
Block a user