mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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
1 changed files with 3 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue