builder.py: check is_package_module for v2 support (#50298)

This commit is contained in:
Harmen Stoppels
2025-05-05 14:08:58 +02:00
committed by GitHub
parent 4a22df5477
commit 1527e9703d

View File

@@ -59,7 +59,7 @@ def __call__(self, spec, prefix):
def get_builder_class(pkg, name: str) -> Optional[Type["Builder"]]:
"""Return the builder class if a package module defines it."""
cls = getattr(pkg.module, name, None)
if cls and cls.__module__.startswith(spack.repo.PKG_MODULE_PREFIX_V1):
if cls and spack.repo.is_package_module(cls.__module__):
return cls
return None