Skip to content

Commit fbb0151

Browse files
[3.11] IDLE: Condense run.main threading.Thread start. (pythonGH-106125) (python#106153)
IDLE: Condense run.main threading.Thread start. (pythonGH-106125) Use daemon argument added in 3.3 and directly call .start. Remove now unused 'sockthread' name. (cherry picked from commit eaa1eae) Co-authored-by: Terry Jan Reedy <[email protected]>
1 parent 86dbf1d commit fbb0151

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Lib/idlelib/run.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,12 @@ def main(del_exitfunc=False):
140140

141141
capture_warnings(True)
142142
sys.argv[:] = [""]
143-
sockthread = threading.Thread(target=manage_socket,
144-
name='SockThread',
145-
args=((LOCALHOST, port),))
146-
sockthread.daemon = True
147-
sockthread.start()
143+
threading.Thread(target=manage_socket,
144+
name='SockThread',
145+
args=((LOCALHOST, port),),
146+
daemon=True,
147+
).start()
148+
148149
while True:
149150
try:
150151
if exit_now:

0 commit comments

Comments
 (0)