mirror of https://github.com/python/cpython
Fix new bug in ftplib.py introduced by exception scope limitation.
This commit is contained in:
parent
3a4e97861f
commit
56be3b1cdc
|
@ -119,7 +119,8 @@ class FTP:
|
||||||
try:
|
try:
|
||||||
self.sock = socket.socket(af, socktype, proto)
|
self.sock = socket.socket(af, socktype, proto)
|
||||||
self.sock.connect(sa)
|
self.sock.connect(sa)
|
||||||
except socket.error as msg:
|
except socket.error as err:
|
||||||
|
msg = err
|
||||||
if self.sock:
|
if self.sock:
|
||||||
self.sock.close()
|
self.sock.close()
|
||||||
self.sock = None
|
self.sock = None
|
||||||
|
|
Loading…
Reference in New Issue