]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 7.4.1256 v7.4.1256
authorBram Moolenaar <Bram@vim.org>
Wed, 3 Feb 2016 23:11:37 +0000 (00:11 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 3 Feb 2016 23:11:37 +0000 (00:11 +0100)
Problem:    On Mac sys.exit(0) doesn't kill the test server.
Solution:   Use self.server.shutdown(). (Jun Takimoto)

src/testdir/test_channel.py
src/version.c

index dbf9eb2c7b5b1053aba93a48000a50df5d6455c8..fb75938c1fc948300116797ca2a06a3c8a7d72c5 100644 (file)
@@ -98,7 +98,8 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
                         response = last_eval
                     elif decoded[1] == '!quit!':
                         # we're done
-                        sys.exit(0)
+                        self.server.shutdown()
+                        break
                     elif decoded[1] == '!crash!':
                         # Crash!
                         42 / 0
@@ -127,7 +128,6 @@ if __name__ == "__main__":
     server_thread = threading.Thread(target=server.serve_forever)
 
     # Exit the server thread when the main thread terminates
-    server_thread.daemon = True
     server_thread.start()
 
     # Write the port number in Xportnr, so that the test knows it.
@@ -135,6 +135,7 @@ if __name__ == "__main__":
     f.write("{}".format(port))
     f.close()
 
-    # Block here
     print("Listening on port {}".format(port))
-    server.serve_forever()
+
+    # Main thread terminates, but the server continues running
+    # until server.shutdown() is called.
index 0f87c416fd08fb4a82ba38e9d267759d8e8ee0a9..b318dc7101757889e9f5881d3bbb17feb94b0c43 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1256,
 /**/
     1255,
 /**/