mirror of https://github.com/python/cpython
In FTP.close() method, make sure to also close the socket object, not only the file.
This commit is contained in:
parent
4cfa24757b
commit
d686848807
|
@ -589,11 +589,11 @@ class FTP:
|
|||
|
||||
def close(self):
|
||||
'''Close the connection without assuming anything about it.'''
|
||||
if self.file:
|
||||
if self.file is not None:
|
||||
self.file.close()
|
||||
if self.sock is not None:
|
||||
self.sock.close()
|
||||
self.file = self.sock = None
|
||||
|
||||
self.file = self.sock = None
|
||||
|
||||
try:
|
||||
import ssl
|
||||
|
|
Loading…
Reference in New Issue