From 2ad2569c721c6179667a16d1a6f2df4f93606636 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Martin=20v=2E=20L=C3=B6wis?= <martin@v.loewis.de>
Date: Tue, 31 Jul 2001 08:40:21 +0000
Subject: [PATCH] Initialize msg to avoid unbound locals.

---
 Lib/ftplib.py    | 2 ++
 Lib/httplib.py   | 1 +
 Lib/poplib.py    | 1 +
 Lib/smtplib.py   | 1 +
 Lib/telnetlib.py | 1 +
 5 files changed, 6 insertions(+)

diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index 885b5cdfa2..fda7864a69 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:
diff --git a/Lib/httplib.py b/Lib/httplib.py
index 10388319c9..7ab914953a 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -357,6 +357,7 @@ class HTTPConnection:
 
     def connect(self):
         """Connect to the host and port specified in __init__."""
+        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:
diff --git a/Lib/poplib.py b/Lib/poplib.py
index 592f7dfa90..98b81ce620 100644
--- a/Lib/poplib.py
+++ b/Lib/poplib.py
@@ -75,6 +75,7 @@ class POP3:
     def __init__(self, host, port = POP3_PORT):
         self.host = host
         self.port = port
+        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:
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index 27cda4056e..3d28b0d566 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -217,6 +217,7 @@ class SMTP:
                     raise socket.error, "nonnumeric port"
         if not port: port = SMTP_PORT
         if self.debuglevel > 0: print 'connect:', (host, port)
+        msg = "getaddrinfo returns an empty list"
         for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
             af, socktype, proto, canonname, sa = res
             try:
diff --git a/Lib/telnetlib.py b/Lib/telnetlib.py
index 5bac9e770c..3731be7dee 100644
--- a/Lib/telnetlib.py
+++ b/Lib/telnetlib.py
@@ -136,6 +136,7 @@ class Telnet:
             port = TELNET_PORT
         self.host = host
         self.port = port
+        msg = "getaddrinfo returns an empty list"
         for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
             af, socktype, proto, canonname, sa = res
             try:
-- 
2.40.0