From 44e6fefc23c35492060a1d4a1dda7f683a7fded4 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 4 Jul 2024 14:35:38 -0300 Subject: [PATCH] Use a daemon thread to load_slow_imports --- aider/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aider/main.py b/aider/main.py index a7220e6c9..0c7ac4508 100644 --- a/aider/main.py +++ b/aider/main.py @@ -548,7 +548,9 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F if args.exit: return - threading.Thread(target=load_slow_imports).start() + thread = threading.Thread(target=load_slow_imports) + thread.daemon = True + thread.start() while True: try: @@ -564,6 +566,7 @@ def load_slow_imports(): # improve startup time. # This func is called in a thread to load them in the background # while we wait for the user to type their first message. + try: import httpx # noqa: F401 import litellm # noqa: F401