From a67a5c8098726aa02971b3168a271ac26cc16bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20B=C3=B6hling?= Date: Sat, 4 Jan 2025 18:32:05 +0100 Subject: [PATCH] [bugfix] AttributeError in refresh.template.py AttributeError: 'bool' object has no attribute 'relative_to' - Bug introduced during the reversion of changes (https://github.com/hedronvision/bazel-compile-commands-extractor/commit/0b821b7e4286aec887757461366f6eaaa0972cb9#diff-a1d7061df7c566a1f7656624ec608ad53dd3aff7a7789b9b6e4866a3b1616042R502). - Reverted to the previous implementation to fix the issue. --- refresh.template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refresh.template.py b/refresh.template.py index 194f365e..a405f337 100644 --- a/refresh.template.py +++ b/refresh.template.py @@ -501,7 +501,7 @@ def _file_is_in_main_workspace_and_not_external(file_str: str): workspace_absolute = pathlib.PurePath(os.environ["BUILD_WORKSPACE_DIRECTORY"]) if not _is_relative_to(file_path, workspace_absolute): return False - file_path = _is_relative_to(file_path, workspace_absolute) + file_path = file_path.relative_to(workspace_absolute) # You can now assume that the path is relative to the workspace. # [Already assuming that relative paths are relative to the main workspace.]