0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 8.2.4690: channel tests fail on MS-Windows

Problem:    Channel tests fail on MS-Windows.
Solution:   Check if the AF_UNIX attribute exists. (closes #10083)
This commit is contained in:
LemonBoy
2022-04-04 21:13:35 +01:00
committed by Bram Moolenaar
parent d0fb2d8041
commit 1b76a8dfe2
3 changed files with 15 additions and 8 deletions

View File

@@ -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.