[Python-checkins] cpython (2.7): Issue #13140: Fix the daemon_threads attribute of ThreadingMixIn.

florent.xicluna python-checkins at python.org
Fri Nov 4 10:23:29 CET 2011


http://hg.python.org/cpython/rev/f09e3b1603ee
changeset:   73347:f09e3b1603ee
branch:      2.7
parent:      73306:d1cde7081bf5
user:        Florent Xicluna <florent.xicluna at gmail.com>
date:        Fri Nov 04 10:15:57 2011 +0100
summary:
  Issue #13140: Fix the daemon_threads attribute of ThreadingMixIn.

files:
  Lib/SocketServer.py           |  3 +--
  Lib/test/test_socketserver.py |  1 -
  Misc/NEWS                     |  2 ++
  3 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/Lib/SocketServer.py b/Lib/SocketServer.py
--- a/Lib/SocketServer.py
+++ b/Lib/SocketServer.py
@@ -589,8 +589,7 @@
         """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
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -123,7 +123,6 @@
         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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -74,6 +74,8 @@
 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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list