From: Bob Halley Date: Tue, 6 Oct 2015 14:37:41 +0000 (-0700) Subject: In python 3, the getaddrinfo 'socktype' parameter was renamed to 'type' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ebdf8eff99e08040b43a5f443672c58a281e59f;p=thirdparty%2Fdnspython.git In python 3, the getaddrinfo 'socktype' parameter was renamed to 'type' --- diff --git a/dns/resolver.py b/dns/resolver.py index 443e1d06..df64065e 100644 --- a/dns/resolver.py +++ b/dns/resolver.py @@ -1074,7 +1074,7 @@ _original_gethostbyname = socket.gethostbyname _original_gethostbyname_ex = socket.gethostbyname_ex _original_gethostbyaddr = socket.gethostbyaddr -def _getaddrinfo(host=None, service=None, family=socket.AF_UNSPEC, socktype=0, +def _getaddrinfo(host=None, service=None, family=socket.AF_UNSPEC, type=0, proto=0, flags=0): if flags & (socket.AI_ADDRCONFIG|socket.AI_V4MAPPED) != 0: raise NotImplementedError @@ -1150,10 +1150,10 @@ def _getaddrinfo(host=None, service=None, family=socket.AF_UNSPEC, socktype=0, if port is None: raise socket.gaierror(socket.EAI_NONAME) tuples = [] - if socktype == 0: + if type == 0: socktypes = [socket.SOCK_DGRAM, socket.SOCK_STREAM] else: - socktypes = [socktype] + socktypes = [type] if flags & socket.AI_CANONNAME != 0: cname = canonical_name else: