diff --git a/aider/main.py b/aider/main.py index aca80da84..28080e7f1 100644 --- a/aider/main.py +++ b/aider/main.py @@ -686,9 +686,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F if args.exit: return - thread = threading.Thread(target=load_slow_imports) - thread.daemon = True - thread.start() + launch_slow_imports_thread() while True: try: @@ -706,6 +704,12 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F coder.show_announcements() +def launch_slow_imports_thread(): + thread = threading.Thread(target=load_slow_imports) + thread.daemon = True + thread.start() + + def load_slow_imports(): # These imports are deferred in various ways to # improve startup time.