Kaydet (Commit) d6868488 authored tarafından Giampaolo Rodolà's avatar Giampaolo Rodolà

In FTP.close() method, make sure to also close the socket object, not only the file.

üst 4cfa2475
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment