mirror of
https://github.com/python/cpython.git
synced 2024-11-25 10:54:51 +08:00
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:
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user