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:
Paul Gauthier 2023-05-13 07:10:29 -07:00
parent 6724fcd897
commit 79dfba98d3

View file

@ -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_"