From a97ef832d90158cde81b74e29a0cd90d3df66f4c Mon Sep 17 00:00:00 2001 From: Cyrus Harrison Date: Wed, 21 Apr 2021 08:21:21 -0700 Subject: conduit package: avoid issue with subclass case (#23156) * avoid issue with subclass case * catch named exception --- var/spack/repos/builtin/packages/conduit/package.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/conduit/package.py b/var/spack/repos/builtin/packages/conduit/package.py index 4f1bd9993c..0acdea9d38 100644 --- a/var/spack/repos/builtin/packages/conduit/package.py +++ b/var/spack/repos/builtin/packages/conduit/package.py @@ -422,9 +422,13 @@ class Conduit(CMakePackage): 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")) -- cgit v1.2.3-60-g2f50