mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
fix ftplib resource warnings
This commit is contained in:
parent
d5df36d378
commit
1bd93a754f
2 changed files with 3 additions and 0 deletions
|
@ -361,6 +361,7 @@ class FTP:
|
||||||
conn, sockaddr = sock.accept()
|
conn, sockaddr = sock.accept()
|
||||||
if self.timeout is not _GLOBAL_DEFAULT_TIMEOUT:
|
if self.timeout is not _GLOBAL_DEFAULT_TIMEOUT:
|
||||||
conn.settimeout(self.timeout)
|
conn.settimeout(self.timeout)
|
||||||
|
sock.close()
|
||||||
if resp[:3] == '150':
|
if resp[:3] == '150':
|
||||||
# this is conditional in case we received a 125
|
# this is conditional in case we received a 125
|
||||||
size = parse150(resp)
|
size = parse150(resp)
|
||||||
|
|
|
@ -355,6 +355,8 @@ if ssl is not None:
|
||||||
if (isinstance(self.socket, ssl.SSLSocket) and
|
if (isinstance(self.socket, ssl.SSLSocket) and
|
||||||
self.socket._sslobj is not None):
|
self.socket._sslobj is not None):
|
||||||
self._do_ssl_shutdown()
|
self._do_ssl_shutdown()
|
||||||
|
else:
|
||||||
|
super(SSLConnection, self).close()
|
||||||
|
|
||||||
|
|
||||||
class DummyTLS_DTPHandler(SSLConnection, DummyDTPHandler):
|
class DummyTLS_DTPHandler(SSLConnection, DummyDTPHandler):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue