mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
fix: move file watcher cleanup to correct finally block
This commit is contained in:
parent
c16224b37a
commit
923d9a0df2
1 changed files with 6 additions and 6 deletions
12
aider/io.py
12
aider/io.py
|
@ -447,6 +447,12 @@ class InputOutput:
|
|||
except UnicodeEncodeError as err:
|
||||
self.tool_error(str(err))
|
||||
return ""
|
||||
finally:
|
||||
# Clean up the watcher thread
|
||||
stop_event.set()
|
||||
watcher.join(timeout=1.0) # Wait up to 1 second for thread to finish
|
||||
if watcher.is_alive():
|
||||
self.tool_warning("Warning: File watcher thread did not shut down cleanly")
|
||||
|
||||
if line and line[0] == "{" and not multiline_input:
|
||||
multiline_input = True
|
||||
|
@ -465,12 +471,6 @@ class InputOutput:
|
|||
self.user_input(inp)
|
||||
return inp
|
||||
|
||||
finally:
|
||||
# Clean up the watcher thread
|
||||
stop_event.set()
|
||||
watcher.join(timeout=1.0) # Wait up to 1 second for thread to finish
|
||||
if watcher.is_alive():
|
||||
self.tool_warning("Warning: File watcher thread did not shut down cleanly")
|
||||
|
||||
def add_to_input_history(self, inp):
|
||||
if not self.input_history_file:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue