summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2024-10-29 07:51:36 +0100
committerGitHub <noreply@github.com>2024-10-29 07:51:36 +0100
commitf81ca0cd89595835b634b77d0f63ab0bd6156331 (patch)
tree80c952df0d02633808f81a04f50a4c56d88f662b /lib
parent25a5585f7d404d102826f4ad3066b34012d6ded7 (diff)
downloadspack-f81ca0cd89595835b634b77d0f63ab0bd6156331.tar.gz
spack-f81ca0cd89595835b634b77d0f63ab0bd6156331.tar.bz2
spack-f81ca0cd89595835b634b77d0f63ab0bd6156331.tar.xz
spack-f81ca0cd89595835b634b77d0f63ab0bd6156331.zip
directives_meta.py: use startswith to test module part of spack.pkg (#47270)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/directives_meta.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/spack/spack/directives_meta.py b/lib/spack/spack/directives_meta.py
index 0768a40664..70ba0298a8 100644
--- a/lib/spack/spack/directives_meta.py
+++ b/lib/spack/spack/directives_meta.py
@@ -10,6 +10,7 @@ from typing import List, Set
import llnl.util.lang
import spack.error
+import spack.repo
import spack.spec
#: Names of possible directives. This list is mostly populated using the @directive decorator.
@@ -63,7 +64,7 @@ class DirectiveMeta(type):
# The instance is being initialized: if it is a package we must ensure
# that the directives are called to set it up.
- if "spack.pkg" in cls.__module__:
+ if cls.__module__.startswith(spack.repo.ROOT_PYTHON_NAMESPACE):
# Ensure the presence of the dictionaries associated with the directives.
# All dictionaries are defaultdicts that create lists for missing keys.
for d in DirectiveMeta._directive_dict_names: