diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 1bf562a03d5..f9370d8e52d 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -50,6 +50,8 @@ except ImportError: def get_cid(): if fcntl is None: return None + if not hasattr(socket, 'IOCTL_VM_SOCKETS_GET_LOCAL_CID'): + return None try: with open("/dev/vsock", "rb") as f: r = fcntl.ioctl(f, socket.IOCTL_VM_SOCKETS_GET_LOCAL_CID, " ")