fix ftplib resource warnings

This commit is contained in:
Benjamin Peterson 2010-10-31 19:58:07 +00:00
parent d5df36d378
commit 1bd93a754f
2 changed files with 3 additions and 0 deletions

View file

@ -361,6 +361,7 @@ class FTP:
conn, sockaddr = sock.accept()
if self.timeout is not _GLOBAL_DEFAULT_TIMEOUT:
conn.settimeout(self.timeout)
sock.close()
if resp[:3] == '150':
# this is conditional in case we received a 125
size = parse150(resp)