]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
In python 3, the getaddrinfo 'socktype' parameter was renamed to 'type'
authorBob Halley <halley@play-bow.org>
Tue, 6 Oct 2015 14:37:41 +0000 (07:37 -0700)
committerBob Halley <halley@play-bow.org>
Tue, 6 Oct 2015 14:37:41 +0000 (07:37 -0700)
dns/resolver.py

index 443e1d06b644b1dae8d0656690be03840b083037..df64065eec5bad7d0145a33f48a5a2c0c8fd0082 100644 (file)
@@ -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: