From ef7e565f71548ac6bc772f018449f578fa09c85c Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:33:39 +0000 Subject: [PATCH] Fix type-checker and lint CI failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add explicit type hint for cloned_context to fix mypy error - Fix pre-existing lint error: use raw string for regex pattern Co-Authored-By: João --- src/crewai/task.py | 1 + tests/test_task.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crewai/task.py b/src/crewai/task.py index 7efaa85eb..ea83b950c 100644 --- a/src/crewai/task.py +++ b/src/crewai/task.py @@ -671,6 +671,7 @@ Follow these guidelines: copied_data = self.model_dump(exclude=exclude) copied_data = {k: v for k, v in copied_data.items() if v is not None} + cloned_context: list["Task"] | None | _NotSpecified if self.context is NOT_SPECIFIED: cloned_context = self.context else: diff --git a/tests/test_task.py b/tests/test_task.py index 83e4ed88b..efc07b33b 100644 --- a/tests/test_task.py +++ b/tests/test_task.py @@ -1271,7 +1271,7 @@ def test_create_directory_false(): assert not resolved_dir.exists() with pytest.raises( - RuntimeError, match="Directory .* does not exist and create_directory is False" + RuntimeError, match=r"Directory .* does not exist and create_directory is False" ): task._save_file("test content")