summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_channel_unix.py
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2022-04-04 21:13:35 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-04 21:13:35 +0100
commit1b76a8dfe21903d6f3ff190e84f3690ee7a73643 (patch)
tree6fb6be679c8a04b74f3f77e0d26b62a107255483 /src/testdir/test_channel_unix.py
parentd0fb2d804183c2786578b4c32ba5b92938f93d0e (diff)
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)
Diffstat (limited to 'src/testdir/test_channel_unix.py')
-rw-r--r--src/testdir/test_channel_unix.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/testdir/test_channel_unix.py b/src/testdir/test_channel_unix.py
index 4836e26ab8..85e780a388 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.