conduit package: avoid issue with subclass case (#23156)

* avoid issue with subclass case

* catch named exception
This commit is contained in:
Cyrus Harrison 2021-04-21 08:21:21 -07:00 committed by GitHub
parent 8182994cee
commit a97ef832d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -422,9 +422,13 @@ def hostconfig(self, spec, prefix):
cfg.write("# python from spack \n")
cfg.write(cmake_cache_entry("PYTHON_EXECUTABLE",
spec['python'].command.path))
cfg.write("# python module install dir\n")
cfg.write(cmake_cache_entry("PYTHON_MODULE_INSTALL_PREFIX",
site_packages_dir))
try:
cfg.write("# python module install dir\n")
cfg.write(cmake_cache_entry("PYTHON_MODULE_INSTALL_PREFIX",
site_packages_dir))
except NameError:
# spack's won't exist in a subclass
pass
else:
cfg.write(cmake_cache_entry("ENABLE_PYTHON", "OFF"))