File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -435,7 +435,7 @@ def open_connection(self):
435435 """Open the TCP/IP connection to the MySQL server
436436 """
437437 # Get address information
438- addrinfo = None
438+ addrinfo = [ None ] * 5
439439 try :
440440 addrinfos = socket .getaddrinfo (self .server_host ,
441441 self .server_port ,
@@ -449,10 +449,10 @@ def open_connection(self):
449449 elif info [0 ] == socket .AF_INET :
450450 addrinfo = info
451451 break
452- if self .force_ipv6 and not addrinfo :
452+ if self .force_ipv6 and addrinfo [ 0 ] is None :
453453 raise errors .InterfaceError (
454454 "No IPv6 address found for {0}" .format (self .server_host ))
455- if not addrinfo :
455+ if addrinfo [ 0 ] is None :
456456 addrinfo = addrinfos [0 ]
457457 except IOError as err :
458458 raise errors .InterfaceError (
You can’t perform that action at this time.
0 commit comments