Add try-except for Python installation (#14122)

This commit is contained in:
Adam J. Stewart 2019-12-11 20:16:33 -06:00 committed by GitHub
parent 47615566ea
commit 7ec1917d9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -623,11 +623,15 @@ def home(self):
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]