From b328b5d169d2e865f9e373321513197670adb7aa Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Sun, 5 Jan 2025 09:47:58 -0600 Subject: [PATCH] PythonPackage: call python and pass env mods --- lib/spack/spack/build_systems/python.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/spack/spack/build_systems/python.py b/lib/spack/spack/build_systems/python.py index 01e8265aff7..b74011166e6 100644 --- a/lib/spack/spack/build_systems/python.py +++ b/lib/spack/spack/build_systems/python.py @@ -243,8 +243,7 @@ def test_imports(self) -> None: self.spec, context=spack.context.Context.RUN ) mods = setup_context.get_env_modifications() - with mods.set_env(): - python("-c", f"import {module}") + python("-c", f"import {module}", env=mods) def update_external_dependencies(self, extendee_spec=None): """