From: Florent Xicluna Date: Fri, 4 Nov 2011 09:15:57 +0000 (+0100) Subject: Issue #13140: Fix the daemon_threads attribute of ThreadingMixIn. X-Git-Tag: v2.7.3rc1~332 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f761d79c0578c24f72663493915b8975e246fbd;p=python Issue #13140: Fix the daemon_threads attribute of ThreadingMixIn. --- diff --git a/Lib/SocketServer.py b/Lib/SocketServer.py index 71b9caa973..2ff388836a 100644 --- a/Lib/SocketServer.py +++ b/Lib/SocketServer.py @@ -589,8 +589,7 @@ class ThreadingMixIn: """Start a new thread to process the request.""" t = threading.Thread(target = self.process_request_thread, args = (request, client_address)) - if self.daemon_threads: - t.setDaemon (1) + t.daemon = self.daemon_threads t.start() diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py index 41634e73a2..08fb03350d 100644 --- a/Lib/test/test_socketserver.py +++ b/Lib/test/test_socketserver.py @@ -123,7 +123,6 @@ class SocketServerTest(unittest.TestCase): self.assertEqual(server.server_address, server.socket.getsockname()) return server - @unittest.skipUnless(threading, 'Threading required for this test.') @reap_threads def run_server(self, svrcls, hdlrbase, testfunc): server = self.make_server(self.pickaddr(svrcls.address_family), diff --git a/Misc/NEWS b/Misc/NEWS index c7637beca0..2701b87013 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -74,6 +74,8 @@ Core and Builtins Library ------- +- Issue #13140: Fix the daemon_threads attribute of ThreadingMixIn. + - Issue #2892: preserve iterparse events in case of SyntaxError. - Issue #670664: Fix HTMLParser to correctly handle the content of