Skip to content

Commit 25767aa

Browse files
committed
wsgi server: fix python 2.7 compatibility
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
1 parent 729a02b commit 25767aa

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

prometheus_client/exposition.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,9 @@ class ThreadingWSGIServer(ThreadingMixIn, WSGIServer):
143143
daemon_threads = True
144144

145145

146-
def _get_best_family(*address):
147-
infos = socket.getaddrinfo(
148-
*address,
149-
type=socket.SOCK_STREAM,
150-
flags=socket.AI_PASSIVE,
151-
)
152-
family, type, proto, canonname, sockaddr = next(iter(infos))
146+
def _get_best_family(address, port):
147+
infos = socket.getaddrinfo(address, port)
148+
family, _, _, _, sockaddr = next(iter(infos))
153149
return family, sockaddr[0]
154150

155151

0 commit comments

Comments
 (0)