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

Method shutdown

Lib/imaplib.py:418–431  ·  view source on GitHub ↗

Close I/O established in "open".

(self)

Source from the content-addressed store, hash-verified

416
417
418 def shutdown(self):
419 """Close I/O established in "open"."""
420 self._file.close()
421 try:
422 self.sock.shutdown(socket.SHUT_RDWR)
423 except OSError as exc:
424 # The server might already have closed the connection.
425 # On Windows, this may result in WSAEINVAL (error 10022):
426 # An invalid operation was attempted.
427 if (exc.errno != errno.ENOTCONN
428 and getattr(exc, 'winerror', 0) != 10022):
429 raise
430 finally:
431 self.sock.close()
432
433
434 def socket(self):

Callers 2

__init__Method · 0.95
logoutMethod · 0.95

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected