From 0ea52b412f55cd1ae3419efb3f0b2cbffe7f8fa7 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 5 Jul 2023 21:11:46 -0700 Subject: [PATCH] cleanup --- aider/io.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/aider/io.py b/aider/io.py index eb4f15f32..0631e82ed 100644 --- a/aider/io.py +++ b/aider/io.py @@ -134,7 +134,7 @@ class InputOutput: current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") self.append_chat_history(f"\n# aider chat started at {current_time}\n\n") - + def read_text(self, filename): try: with open(filename, "r", encoding=self.encoding) as f: @@ -144,12 +144,8 @@ class InputOutput: return def write_text(self, filename, content): - try: - with open(filename, "w", encoding=self.encoding) as f: - f.write(content) - except (FileNotFoundError, UnicodeError) as e: - self.tool_error(f"{filename}: {e}") - return + with open(filename, "w", encoding=self.encoding) as f: + f.write(content) def get_input(self, root, rel_fnames, addable_rel_fnames, commands): if self.pretty: