mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
![]() # Context: USER: ImportError: cannot import name 'redirect_stdin' from 'contextlib'. Maybe just close stdin before calling main? ASSISTANT: To fix the ImportError, we can replace the usage of `redirect_stdin` with closing stdin before calling `main`. Here's the change: ```python tests/test_main.py <<<<<<< ORIGINAL from contextlib import redirect_stdin ======= >>>>>>> UPDATED ``` ```python tests/test_main.py <<<<<<< ORIGINAL with open(os.devnull, 'r') as dev_null: with redirect_stdin(dev_null): main() ======= with open(os.devnull, 'r') as dev_null: sys.stdin.close() main() >>>>>>> UPDATED ``` |
||
---|---|---|
.. | ||
__init__.py | ||
test_main.py | ||
test_utils.py |