Skip to content

Commit d40192e

Browse files
committed
BUG19711759: Fix Pylint issue in network module
We fix Pylint W0633 warning in mysql.connector.network module with message "Attempting to unpack a non-sequence define at line 438".
1 parent 47a309b commit d40192e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/mysql/connector/network.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)