From 9fc7f62e7f194e1b39f3d5c602e4d21f698273e4 Mon Sep 17 00:00:00 2001 From: Evan Purcell <169938107+evanpurcell@users.noreply.github.com> Date: Tue, 24 Jun 2025 17:37:22 -0700 Subject: [PATCH] Fix refresh.template.py for cases when aquery environment results do not contain values. --- refresh.template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refresh.template.py b/refresh.template.py index 194f365e..b8fe566a 100644 --- a/refresh.template.py +++ b/refresh.template.py @@ -1103,7 +1103,7 @@ def _get_cpp_command_for_files(compile_action): Undo Bazel-isms and figures out which files clangd should apply the command to. """ # Condense aquery's environment variables into a dictionary, the format you might expect. - compile_action.environmentVariables = {pair.key: pair.value for pair in getattr(compile_action, 'environmentVariables', [])} + compile_action.environmentVariables = {pair.key: pair.value if hasattr(pair,'value') else "" for pair in getattr(compile_action, 'environmentVariables', [])} if 'PATH' not in compile_action.environmentVariables: # Bazel only adds if --incompatible_strict_action_env is passed--and otherwise inherits. compile_action.environmentVariables['PATH'] = os.environ['PATH']