mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-04 03:35:00 +00:00
refactor to use io.write_text
This commit is contained in:
parent
0ea52b412f
commit
b46dffbb20
5 changed files with 16 additions and 15 deletions
|
@ -137,14 +137,14 @@ class InputOutput:
|
|||
|
||||
def read_text(self, filename):
|
||||
try:
|
||||
with open(filename, "r", encoding=self.encoding) as f:
|
||||
with open(str(filename), "r", encoding=self.encoding) as f:
|
||||
return f.read()
|
||||
except (FileNotFoundError, UnicodeError) as e:
|
||||
self.tool_error(f"{filename}: {e}")
|
||||
return
|
||||
|
||||
def write_text(self, filename, content):
|
||||
with open(filename, "w", encoding=self.encoding) as f:
|
||||
with open(str(filename), "w", encoding=self.encoding) as f:
|
||||
f.write(content)
|
||||
|
||||
def get_input(self, root, rel_fnames, addable_rel_fnames, commands):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue