From 7ec1917d9b7141b5eda59a5fbd0890936150653a Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Wed, 11 Dec 2019 20:16:33 -0600 Subject: Add try-except for Python installation (#14122) --- var/spack/repos/builtin/packages/python/package.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'var') 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] -- cgit v1.2.3-70-g09d2