From b6b4fc6fab762e881f1ad9194ce5c6d859a7055c Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 31 Aug 2024 08:08:49 -0700 Subject: [PATCH] refactor: replace .touch() calls with utils.touch_file() --- aider/coders/base_coder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 427f3214e..10e848a1f 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -352,7 +352,7 @@ class Coder: if not fname.exists(): self.io.tool_output(f"Creating empty file {fname}") fname.parent.mkdir(parents=True, exist_ok=True) - fname.touch() + utils.touch_file(fname) if not fname.is_file(): raise ValueError(f"{fname} is not a file") @@ -1678,7 +1678,7 @@ class Coder: if not self.dry_run: Path(full_path).parent.mkdir(parents=True, exist_ok=True) - Path(full_path).touch() + utils.touch_file(Path(full_path)) # Seems unlikely that we needed to create the file, but it was # actually already part of the repo.