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

View File

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