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

Method __exit__

Lib/ftplib.py:129–137  ·  view source on GitHub ↗
(self, *args)

Source from the content-addressed store, hash-verified

127
128 # Context management protocol: try to quit() if active
129 def __exit__(self, *args):
130 if self.sock is not None:
131 try:
132 self.quit()
133 except (OSError, EOFError):
134 pass
135 finally:
136 if self.sock is not None:
137 self.close()
138
139 def connect(self, host='', port=0, timeout=-999, source_address=None):
140 '''Connect to host. Arguments are:

Callers

nothing calls this directly

Calls 2

quitMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected