Issue 16646 (ftplib): deliberately use intermediate variable after catching exception

This commit is contained in:
Giampaolo Rodola' 2012-12-17 20:46:45 +01:00
commit 5ee29491e5
1 changed files with 2 additions and 1 deletions

View File

@ -295,7 +295,8 @@ class FTP:
try: try:
sock = socket.socket(af, socktype, proto) sock = socket.socket(af, socktype, proto)
sock.bind(sa) sock.bind(sa)
except socket.error as err: except socket.error as _:
err = _
if sock: if sock:
sock.close() sock.close()
sock = None sock = None