From 33f7b81517cd737186fd026ce8ecda7c3af13b66 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 10 May 2023 10:08:16 -0700 Subject: [PATCH] aider: Replaced `Path.name` with `os.path.basename`. # Context: USER: replace the Path.name with os.path equiv ASSISTANT: To replace the `Path.name` with the equivalent `os.path` function, you can use `os.path.basename`. Here's the change: ```python aider/getinput.py <<<<<<< ORIGINAL short_fnames = [Path(fnames[0]).name] ======= short_fnames = [os.path.basename(fnames[0])] >>>>>>> UPDATED ``` --- aider/getinput.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aider/getinput.py b/aider/getinput.py index c7750fd44..20f01c3a7 100644 --- a/aider/getinput.py +++ b/aider/getinput.py @@ -55,8 +55,7 @@ def get_input(history_file, fnames): common_prefix = os.path.commonprefix(fnames) short_fnames = [fname.replace(common_prefix, '', 1) for fname in fnames] else: - short_fnames = [Path(fnames[0]).name] - + short_fnames = [os.path.basename(fnames[0])] show = ' '.join(short_fnames) show += "\n> "