Commit 56be3b1c authored by Guido van Rossum's avatar Guido van Rossum

Fix new bug in ftplib.py introduced by exception scope limitation.

parent 3a4e9786
......@@ -119,7 +119,8 @@ class FTP:
try:
self.sock = socket.socket(af, socktype, proto)
self.sock.connect(sa)
except socket.error as msg:
except socket.error as err:
msg = err
if self.sock:
self.sock.close()
self.sock = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment