[Python-checkins] [3.11] IDLE: Condense run.main threading.Thread start. (GH-106125) (#106153)
terryjreedy
webhook-mailer at python.org
Tue Jun 27 13:37:23 EDT 2023
https://github.com/python/cpython/commit/fbb0151e5ec14e2db5699bdb7adcc19d3c0b7267
commit: fbb0151e5ec14e2db5699bdb7adcc19d3c0b7267
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: terryjreedy <tjreedy at udel.edu>
date: 2023年06月27日T17:37:20Z
summary:
[3.11] IDLE: Condense run.main threading.Thread start. (GH-106125) (#106153)
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 at udel.edu>
files:
M Lib/idlelib/run.py
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index 59198b6c6fc12..9830e2b5be44a 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:
More information about the Python-checkins
mailing list