diff options
author | LemonBoy <thatlemon@gmail.com> | 2022-04-04 21:13:35 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-04 21:13:35 +0100 |
commit | 1b76a8dfe21903d6f3ff190e84f3690ee7a73643 (patch) | |
tree | 6fb6be679c8a04b74f3f77e0d26b62a107255483 | |
parent | d0fb2d804183c2786578b4c32ba5b92938f93d0e (diff) | |
download | vim-git-1b76a8dfe21903d6f3ff190e84f3690ee7a73643.tar.gz |
patch 8.2.4690: channel tests fail on MS-Windowsv8.2.4690
Problem: Channel tests fail on MS-Windows.
Solution: Check if the AF_UNIX attribute exists. (closes #10083)
-rw-r--r-- | src/testdir/test_channel.py | 11 | ||||
-rw-r--r-- | src/testdir/test_channel_unix.py | 10 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 15 insertions, 8 deletions
diff --git a/src/testdir/test_channel.py b/src/testdir/test_channel.py index b0c314092..3ef0fde0f 100644 --- a/src/testdir/test_channel.py +++ b/src/testdir/test_channel.py @@ -19,12 +19,7 @@ except ImportError: # Python 2 import SocketServer as socketserver -class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler): - - def setup(self): - if self.server.address_family != socket.AF_UNIX: - self.request.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) - +class TestingRequestHandler(socketserver.BaseRequestHandler): def handle(self): print("=== socket opened ===") while True: @@ -240,6 +235,10 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler): elif decoded[0] < 0: last_eval = decoded +class ThreadedTCPRequestHandler(TestingRequestHandler): + def setup(self): + self.request.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) + class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer): pass diff --git a/src/testdir/test_channel_unix.py b/src/testdir/test_channel_unix.py index 4836e26ab..85e780a38 100644 --- a/src/testdir/test_channel_unix.py +++ b/src/testdir/test_channel_unix.py @@ -6,7 +6,7 @@ # This requires Python 2.6 or later. from __future__ import print_function -from test_channel import ThreadedTCPServer, ThreadedTCPRequestHandler, \ +from test_channel import ThreadedTCPServer, TestingRequestHandler, \ writePortInFile import socket import threading @@ -18,11 +18,17 @@ except NameError: # Python 2 FileNotFoundError = (IOError, OSError) +if not hasattr(socket, "AF_UNIX"): + raise NotImplementedError("Unix sockets are not supported on this platform") + class ThreadedUnixServer(ThreadedTCPServer): address_family = socket.AF_UNIX +class ThreadedUnixRequestHandler(TestingRequestHandler): + pass + def main(path): - server = ThreadedUnixServer(path, ThreadedTCPRequestHandler) + server = ThreadedUnixServer(path, ThreadedUnixRequestHandler) # Start a thread with the server. That thread will then start a new thread # for each connection. diff --git a/src/version.c b/src/version.c index 6e9b1d49a..580526449 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4690, +/**/ 4689, /**/ 4688, |