]> granicus.if.org Git - python/commitdiff
Fix a race condition in test_socket.ThreadableTest: the client is reported as
authorCharles-François Natali <neologix@free.fr>
Wed, 21 Sep 2011 20:03:58 +0000 (22:03 +0200)
committerCharles-François Natali <neologix@free.fr>
Wed, 21 Sep 2011 20:03:58 +0000 (22:03 +0200)
ready before having been set up.

Lib/test/test_socket.py

index baca4c12c7afd64a13cc3d9714f607a4daab097c..197ca0933f2ff78788dcd6707988c8bc08ed8ef9 100644 (file)
@@ -156,8 +156,8 @@ class ThreadableTest:
 
     def clientRun(self, test_func):
         self.server_ready.wait()
-        self.client_ready.set()
         self.clientSetUp()
+        self.client_ready.set()
         if not hasattr(test_func, '__call__'):
             raise TypeError("test_func must be a callable function")
         try: