mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
refactor: revert addition of type hints
This commit is contained in:
parent
c9fc2efdd7
commit
86600c70aa
1 changed files with 5 additions and 6 deletions
|
@ -5,7 +5,6 @@ import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Generator
|
|
||||||
|
|
||||||
import git
|
import git
|
||||||
import pyperclip
|
import pyperclip
|
||||||
|
@ -528,16 +527,16 @@ class Commands:
|
||||||
try:
|
try:
|
||||||
if os.path.isabs(pattern):
|
if os.path.isabs(pattern):
|
||||||
# Handle absolute paths
|
# Handle absolute paths
|
||||||
raw_matched_files: list[Path] = [Path(pattern)]
|
raw_matched_files = [Path(pattern)]
|
||||||
else:
|
else:
|
||||||
raw_matched_files: list[Path] = list(
|
raw_matched_files = list(
|
||||||
Path(self.coder.root).glob(pattern)
|
Path(self.coder.root).glob(pattern)
|
||||||
)
|
)
|
||||||
except ValueError as err:
|
except ValueError as err:
|
||||||
self.io.tool_error(f"Error matching {pattern}: {err}")
|
self.io.tool_error(f"Error matching {pattern}: {err}")
|
||||||
raw_matched_files: list[Path] = []
|
raw_matched_files = []
|
||||||
|
|
||||||
matched_files: list[Path] = []
|
matched_files = []
|
||||||
for fn in raw_matched_files:
|
for fn in raw_matched_files:
|
||||||
matched_files += expand_subdir(fn)
|
matched_files += expand_subdir(fn)
|
||||||
|
|
||||||
|
@ -1079,7 +1078,7 @@ class Commands:
|
||||||
self.io.tool_output(settings)
|
self.io.tool_output(settings)
|
||||||
|
|
||||||
|
|
||||||
def expand_subdir(file_path: Path) -> Generator[Path, None, None]:
|
def expand_subdir(file_path):
|
||||||
if file_path.is_file():
|
if file_path.is_file():
|
||||||
yield file_path
|
yield file_path
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue