MCPcopy Index your code
hub / github.com/python/cpython / close

Method close

Lib/ftplib.py:657–668  ·  view source on GitHub ↗

Close the connection without assuming anything about it.

(self)

Source from the content-addressed store, hash-verified

655 return resp
656
657 def close(self):
658 '''Close the connection without assuming anything about it.'''
659 try:
660 file = self.file
661 self.file = None
662 if file is not None:
663 file.close()
664 finally:
665 sock = self.sock
666 self.sock = None
667 if sock is not None:
668 sock.close()
669
670try:
671 import ssl

Callers 9

__exit__Method · 0.95
quitMethod · 0.95
testTimeoutDefaultMethod · 0.95
testTimeoutNoneMethod · 0.95
testTimeoutValueMethod · 0.95
testTimeoutConnectMethod · 0.95
ntransfercmdMethod · 0.45

Calls

no outgoing calls

Tested by 6

testTimeoutDefaultMethod · 0.76
testTimeoutNoneMethod · 0.76
testTimeoutValueMethod · 0.76
testTimeoutConnectMethod · 0.76