mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Initialize msg to avoid unbound locals.
This commit is contained in:
parent
7d9ed726fb
commit
2ad2569c72
5 changed files with 6 additions and 0 deletions
|
@ -115,6 +115,7 @@ class FTP:
|
|||
if host: self.host = host
|
||||
if port: self.port = port
|
||||
self.passiveserver = 0
|
||||
msg = "getaddrinfo returns an empty list"
|
||||
for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM):
|
||||
af, socktype, proto, canonname, sa = res
|
||||
try:
|
||||
|
@ -270,6 +271,7 @@ class FTP:
|
|||
|
||||
def makeport(self):
|
||||
'''Create a new socket and send a PORT command for it.'''
|
||||
msg = "getaddrinfo returns an empty list"
|
||||
for res in socket.getaddrinfo(None, 0, self.af, socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
|
||||
af, socktype, proto, canonname, sa = res
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue