From 264b54bf51dfbc1c6901389eb4bf8c2f8ea542a7 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Tue, 27 Jun 2023 10:35:48 -0700 Subject: [3.12] IDLE: Condense run.main threading.Thread start. (GH-106125) (#106154) IDLE: Condense run.main threading.Thread start. (GH-106125) Use daemon argument added in 3.3 and directly call .start. Remove now unused 'sockthread' name. (cherry picked from commit eaa1eae55ea66d74c5303924320185dac74d4eb1) Co-authored-by: Terry Jan Reedy --- 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 4ffc90a..53e80a9 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: -- cgit v0.12