mirror of
https://github.com/python/cpython
synced 2024-09-05 08:17:45 +00:00
bpo-43723: Fix deprecation error caused by thread.setDaemon() (GH-25361)
This commit is contained in:
parent
3447750073
commit
95bbb331ec
|
@ -799,7 +799,7 @@ async def client(host, port):
|
|||
|
||||
# Start the server thread and wait for it to be listening.
|
||||
thread = threading.Thread(target=server)
|
||||
thread.setDaemon(True)
|
||||
thread.daemon = True
|
||||
thread.start()
|
||||
addr = q.get()
|
||||
|
||||
|
|
|
@ -849,7 +849,7 @@ def start(self):
|
|||
"""
|
||||
self._thread = t = threading.Thread(target=self.serve_forever,
|
||||
args=(self.poll_interval,))
|
||||
t.setDaemon(True)
|
||||
t.daemon = True
|
||||
t.start()
|
||||
|
||||
def serve_forever(self, poll_interval):
|
||||
|
@ -901,7 +901,7 @@ def start(self):
|
|||
"""
|
||||
self._thread = t = threading.Thread(target=self.serve_forever,
|
||||
args=(self.poll_interval,))
|
||||
t.setDaemon(True)
|
||||
t.daemon = True
|
||||
t.start()
|
||||
|
||||
def serve_forever(self, poll_interval):
|
||||
|
|
|
@ -29,7 +29,7 @@ def setUp(self):
|
|||
self.sock.settimeout(60) # Safety net. Look issue 11812
|
||||
self.port = socket_helper.bind_port(self.sock)
|
||||
self.thread = threading.Thread(target=server, args=(self.evt,self.sock))
|
||||
self.thread.setDaemon(True)
|
||||
self.thread.daemon = True
|
||||
self.thread.start()
|
||||
self.evt.wait()
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ def run():
|
|||
for i in range(nthreads):
|
||||
threads.append(threading.Thread(target=run))
|
||||
for t in threads:
|
||||
t.setDaemon(True)
|
||||
t.daemon = True
|
||||
t.start()
|
||||
# We don't want measurements to include thread startup overhead,
|
||||
# so we arrange for timing to start after all threads are ready.
|
||||
|
@ -328,7 +328,7 @@ def run():
|
|||
for i in range(nthreads):
|
||||
threads.append(threading.Thread(target=run))
|
||||
for t in threads:
|
||||
t.setDaemon(True)
|
||||
t.daemon = True
|
||||
t.start()
|
||||
# Wait for threads to be ready
|
||||
with ready_cond:
|
||||
|
@ -460,7 +460,7 @@ def run():
|
|||
for i in range(nthreads):
|
||||
threads.append(threading.Thread(target=run))
|
||||
for t in threads:
|
||||
t.setDaemon(True)
|
||||
t.daemon = True
|
||||
t.start()
|
||||
# Wait for threads to be ready
|
||||
with ready_cond:
|
||||
|
|
Loading…
Reference in a new issue