Skip to content

Commit bda5ddd

Browse files
authored
s.getsockname() => s.getsockname()[:2]
IPV6 s.getsockname() will return a tuple of length 4.
1 parent 5ba4782 commit bda5ddd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pproxy/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ def print_server_started(option, server, print_fn):
895895
return
896896
for s in sockets:
897897
# https://github.com/MagicStack/uvloop/blob/master/uvloop/pseudosock.pyx
898-
host, port = s.getsockname() # tuple size varies with protocol family
898+
host, port = s.getsockname()[:2] # tuple size varies with protocol family
899899
ipversion = "ipv?"
900900
if s.family == socket.AddressFamily.AF_INET:
901901
ipversion = "ipv4"

0 commit comments

Comments
 (0)