Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Tool fix: Do not use Generator annotation

Kilian Lierete27262a8c748
diff --git a/tools/defaults/lib/default_utils.py b/tools/defaults/lib/default_utils.py
index 364ef8d7..563f8f6c 100644
--- a/tools/defaults/lib/default_utils.py
+++ b/tools/defaults/lib/default_utils.py
@@ -1,6 +1,5 @@
import json
import os
-from collections.abc import Generator
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Optional, Tuple, Union
@@ -48,7 +47,7 @@ class TextNotFound(Exception):
"""Raised when the text is not found in the window."""
-def _find_all(a_str: str, sub: str) -> Generator[int, None, None]:
+def _find_all(a_str: str, sub: str):
start = 0
while True:
start = a_str.find(sub, start)