Skip to content

Commit

Permalink
use explicit runtime error
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed May 12, 2023
1 parent ab2f801 commit d26c599
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xpra/net/socket_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d26c599

Please sign in to comment.