diff options
author | Gregory Lee <lee218@llnl.gov> | 2017-01-23 09:34:50 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2017-01-23 09:34:50 -0800 |
commit | 6bc7be9217f62169e689f9a38fca6c47a2bc2873 (patch) | |
tree | 2650ce23efcbccc786027021f61e022b61ec629c | |
parent | 19699a7607689d11dd66b21b8755e92d98c2b494 (diff) | |
download | spack-6bc7be9217f62169e689f9a38fca6c47a2bc2873.tar.gz spack-6bc7be9217f62169e689f9a38fca6c47a2bc2873.tar.bz2 spack-6bc7be9217f62169e689f9a38fca6c47a2bc2873.tar.xz spack-6bc7be9217f62169e689f9a38fca6c47a2bc2873.zip |
updated config file name for Python 3.6 (#2881)
-rw-r--r-- | var/spack/repos/builtin/packages/python/package.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 348b075e2f..9a04aaf981 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -148,6 +148,16 @@ class Python(Package): 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 @@ class Python(Package): 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 @@ class Python(Package): 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 |