mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
aider: Import 'Path' from 'pathlib' to fix undefined name errors.
# Aider chat conversation: USER: # Running: /Users/gauthier/Projects/aider/tmp.sh aider/coders/wholefile_coder.py aider/coders/wholefile_coder.py aider/coders/wholefile_coder.py:72:62: F821 undefined name 'Path' if fname and fname not in chat_files and Path(fname).name in chat_files: ^ aider/coders/wholefile_coder.py:73:33: F821 undefined name 'Path' fname = Path(fname).name ^ aider/coders/wholefile_coder.py:102:30: F821 undefined name 'Path' full_path = (Path(self.root) / fname).absolute() ^ aider/coders/wholefile_coder.py:132:12: F821 undefined name 'Path' if Path(full_path).exists(): ^ ASSISTANT: To fix the `undefined name 'Path'` errors, we need to import `Path` from the `pathlib` module at the beginning of the file. Here are the necessary changes: aider/coders/wholefile_coder.py <source>python <<<<<<< SEARCH from aider import diffs ======= from pathlib import Path from aider import diffs >>>>>>> REPLACE </source>
This commit is contained in:
parent
5805007885
commit
8a2ce8ec0e
1 changed files with 2 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
from pathlib import Path
|
||||
|
||||
from aider import diffs
|
||||
|
||||
from ..dump import dump # noqa: F401
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue