From eaa1eae55ea66d74c5303924320185dac74d4eb1 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Tue, 27 Jun 2023 13:12:56 -0400 Subject: [PATCH] IDLE: Condense run.main threading.Thread start. (#106125) Use daemon argument added in 3.3 and directly call .start. Remove now unused 'sockthread' name. --- Lib/idlelib/run.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 4ffc90ab0c8..53e80a9b428 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -140,11 +140,12 @@ def main(del_exitfunc=False): capture_warnings(True) sys.argv[:] = [""] - sockthread = threading.Thread(target=manage_socket, - name='SockThread', - args=((LOCALHOST, port),)) - sockthread.daemon = True - sockthread.start() + threading.Thread(target=manage_socket, + name='SockThread', + args=((LOCALHOST, port),), + daemon=True, + ).start() + while True: try: if exit_now: