From 2c2282dcb499be064c78eb48e1243c69854e22c3 Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Wed, 14 May 2025 17:44:29 -0700 Subject: [PATCH] rebase fixup Signed-off-by: Gregory Becker --- lib/spack/spack/spec_parser.py | 8 ++++---- lib/spack/spack/test/conftest.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/spack/spack/spec_parser.py b/lib/spack/spack/spec_parser.py index cfdd46bd502..751ffb88751 100644 --- a/lib/spack/spack/spec_parser.py +++ b/lib/spack/spack/spec_parser.py @@ -286,7 +286,7 @@ def add_dependency(dep, **edge_properties): raise SpecParsingError(str(e), self.ctx.current_token, self.literal_str) from e # Get toolchain information outside of loop - toolchains = spack.config.get("toolchains", {}) + toolchains = spack.config.CONFIG.get("toolchains", {}) initial_spec = initial_spec or spack.spec.Spec() root_spec, parser_warnings = SpecNodeParser(self.ctx, self.literal_str).parse(initial_spec) @@ -319,11 +319,11 @@ def add_dependency(dep, **edge_properties): elif self.ctx.accept(SpecTokens.DEPENDENCY): # String replacement for toolchains # Look ahead to match upcoming value to list of toolchains - if self.next_token.value in toolchains: + if self.ctx.next_token.value in toolchains: assert self.ctx.accept(SpecTokens.UNQUALIFIED_PACKAGE_NAME) - # accepting the token advances it to the current token + # accepting the token advances it to be the current token # Push associated tokens back to the TokenContext - self.ctx.push(parseable_tokens(toolchains[self.current_token.value])) + self.ctx.push(parseable_tokens(toolchains[self.ctx.current_token.value])) continue is_direct = self.ctx.current_token.value[0] == "%" diff --git a/lib/spack/spack/test/conftest.py b/lib/spack/spack/test/conftest.py index b5b8e4d9825..5068cf48338 100644 --- a/lib/spack/spack/test/conftest.py +++ b/lib/spack/spack/test/conftest.py @@ -2054,7 +2054,7 @@ def shell_as(shell): @pytest.fixture() def nullify_globals(request, monkeypatch): ensure_configuration_fixture_run_before(request) - monkeypatch.setattr(spack.config, "CONFIG", None) + monkeypatch.setattr(spack.config, "CONFIG", {}) # So basic get operations do not throw monkeypatch.setattr(spack.caches, "MISC_CACHE", None) monkeypatch.setattr(spack.caches, "FETCH_CACHE", None) monkeypatch.setattr(spack.repo, "PATH", None)