diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2019-12-11 20:16:33 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-11 20:16:33 -0600 |
commit | 7ec1917d9b7141b5eda59a5fbd0890936150653a (patch) | |
tree | 3827d21a3069961bdcfde65eef8834869ee88a30 /var | |
parent | 47615566eadeb0043c586912243e612a4ce94661 (diff) | |
download | spack-7ec1917d9b7141b5eda59a5fbd0890936150653a.tar.gz spack-7ec1917d9b7141b5eda59a5fbd0890936150653a.tar.bz2 spack-7ec1917d9b7141b5eda59a5fbd0890936150653a.tar.xz spack-7ec1917d9b7141b5eda59a5fbd0890936150653a.zip |
Add try-except for Python installation (#14122)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/python/package.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index a92d1c6c79..3bd412b11e 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -623,11 +623,15 @@ class Python(AutotoolsPackage): and symlinks it to ``/usr/local``. Users may not know the actual installation directory and add ``/usr/local`` to their ``packages.yaml`` unknowingly. Query the python executable to - determine exactly where it is installed.""" + determine exactly where it is installed. Fall back on + ``spec['python'].prefix`` if that doesn't work.""" dag_hash = self.spec.dag_hash() if dag_hash not in self._homes: - prefix = self.get_config_var('prefix') + try: + prefix = self.get_config_var('prefix') + except ProcessError: + prefix = self.prefix self._homes[dag_hash] = Prefix(prefix) return self._homes[dag_hash] |