[Python-checkins] cpython: Fix test_socket when built whithout threads.

charles-francois.natali python-checkins at python.org
Thu Nov 10 20:34:14 CET 2011


http://hg.python.org/cpython/rev/fa9bbfc0bcec
changeset:   73485:fa9bbfc0bcec
user:        Charles-François Natali <neologix at free.fr>
date:        Thu Nov 10 20:33:36 2011 +0100
summary:
  Fix test_socket when built whithout threads.

files:
  Lib/test/test_socket.py |  5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -305,7 +305,6 @@
     def __init__(self, methodName='runTest'):
         SocketRDSTest.__init__(self, methodName=methodName)
         ThreadableTest.__init__(self)
-        self.evt = threading.Event()
 
     def clientSetUp(self):
         self.cli = socket.socket(socket.PF_RDS, socket.SOCK_SEQPACKET, 0)
@@ -1316,6 +1315,10 @@
     def __init__(self, methodName='runTest'):
         ThreadedRDSSocketTest.__init__(self, methodName=methodName)
 
+    def setUp(self):
+        super().setUp()
+        self.evt = threading.Event()
+
     def testSendAndRecv(self):
         data, addr = self.serv.recvfrom(self.bufsize)
         self.assertEqual(self.data, data)

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


More information about the Python-checkins mailing list