Skip to content
Snippets Groups Projects
Commit 6bc7be92 authored by Gregory L. Lee's avatar Gregory L. Lee Committed by Todd Gamblin
Browse files

updated config file name for Python 3.6 (#2881)

parent 19699a76
Branches
Tags
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment