We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47a309b commit d40192eCopy full SHA for d40192e
lib/mysql/connector/network.py
@@ -435,7 +435,7 @@ def open_connection(self):
435
"""Open the TCP/IP connection to the MySQL server
436
"""
437
# Get address information
438
- addrinfo = None
+ addrinfo = [None] * 5
439
try:
440
addrinfos = socket.getaddrinfo(self.server_host,
441
self.server_port,
@@ -449,10 +449,10 @@ def open_connection(self):
449
elif info[0] == socket.AF_INET:
450
addrinfo = info
451
break
452
- if self.force_ipv6 and not addrinfo:
+ if self.force_ipv6 and addrinfo[0] is None:
453
raise errors.InterfaceError(
454
"No IPv6 address found for {0}".format(self.server_host))
455
- if not addrinfo:
+ if addrinfo[0] is None:
456
addrinfo = addrinfos[0]
457
except IOError as err:
458
0 commit comments