From d26c599f0f9bd767e8c9cccefdd8ef12d24759fa Mon Sep 17 00:00:00 2001 From: totaam Date: Fri, 12 May 2023 15:15:00 +0700 Subject: [PATCH] use explicit runtime error --- xpra/net/socket_util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xpra/net/socket_util.py b/xpra/net/socket_util.py index 979c61d6bd..1db157f4b5 100644 --- a/xpra/net/socket_util.py +++ b/xpra/net/socket_util.py @@ -420,7 +420,8 @@ def create_tcp_socket(host, iport): else: if host.startswith("[") and host.endswith("]"): host = host[1:-1] - assert socket.has_ipv6, "specified an IPv6 address but this is not supported" + if not socket.has_ipv6: + raise RuntimeError("specified an IPv6 address but this is not supported on this system") res = socket.getaddrinfo(host, iport, socket.AF_INET6, socket.SOCK_STREAM, 0, socket.SOL_TCP) log("socket.getaddrinfo(%s, %s, AF_INET6, SOCK_STREAM, 0, SOL_TCP)=%s", host, iport, res) listener = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)