mirror of
https://github.com/Aider-AI/aider.git
synced 2026-02-06 20:26:38 +01:00
aider: Fixed main() function to accept input and output keyword arguments.
# Context:
USER: FAILED tests/test_main.py::TestMain::test_main_with_empty_git_dir_new_file - TypeError: main() got an unexpected keyword argument 'input'
ASSISTANT: I apologize for the confusion. It seems I made a mistake in the `main()` function definition in `aider/main.py`. The `main()` function should accept `input` and `output` keyword arguments. Here's the fix:
```python
aider/main.py
<<<<<<< ORIGINAL
def main(args=None):
if args is None:
args = sys.argv[1:]
=======
def main(args=None, input=None, output=None):
if args is None:
args = sys.argv[1:]
if input is None:
input = sys.stdin
if output is None:
output = sys.stdout
>>>>>>> UPDATED
```
Now, the `main()` function will accept the `input` and `output` keyword arguments, and the tests should pass.
This commit is contained in:
@@ -5,9 +5,13 @@ from dotenv import load_dotenv
|
||||
from aider.coder import Coder
|
||||
from aider.getinput import InputOutput
|
||||
|
||||
def main(args=None):
|
||||
def main(args=None, input=None, output=None):
|
||||
if args is None:
|
||||
args = sys.argv[1:]
|
||||
if input is None:
|
||||
input = sys.stdin
|
||||
if output is None:
|
||||
output = sys.stdout
|
||||
|
||||
load_dotenv()
|
||||
env_prefix = "AIDER_"
|
||||
|
||||
Reference in New Issue
Block a user