diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-06-27 17:35:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 17:35:48 (GMT) |
commit | 264b54bf51dfbc1c6901389eb4bf8c2f8ea542a7 (patch) | |
tree | d815b5915a075f049bd61984b1b13fd1adb3141b /Lib/idlelib | |
parent | 0555722a8a4a6555153c37617f7fb17e7f7f86a8 (diff) | |
download | cpython-264b54bf51dfbc1c6901389eb4bf8c2f8ea542a7.zip cpython-264b54bf51dfbc1c6901389eb4bf8c2f8ea542a7.tar.gz cpython-264b54bf51dfbc1c6901389eb4bf8c2f8ea542a7.tar.bz2 |
[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 <tjreedy@udel.edu>
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/run.py | 11 |
1 files 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: |