summaryrefslogtreecommitdiffstats
path: root/Lib/ftplib.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-07-31 08:40:21 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-07-31 08:40:21 (GMT)
commit2ad2569c721c6179667a16d1a6f2df4f93606636 (patch)
tree93e1f4c5d1754aae38a36105bc1e051025bb65ac /Lib/ftplib.py
parent7d9ed726fb6ec15dbfb8e922d35aa8816cbd0b0c (diff)
downloadcpython-2ad2569c721c6179667a16d1a6f2df4f93606636.zip
cpython-2ad2569c721c6179667a16d1a6f2df4f93606636.tar.gz
cpython-2ad2569c721c6179667a16d1a6f2df4f93606636.tar.bz2
Initialize msg to avoid unbound locals.
Diffstat (limited to 'Lib/ftplib.py')
-rw-r--r--Lib/ftplib.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index 885b5cd..fda7864 100644
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -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: