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

Method close

Lib/mailbox.py:2055–2062  ·  view source on GitHub ↗

Close the file.

(self)

Source from the content-addressed store, hash-verified

2053 self._pos = self._file.tell()
2054
2055 def close(self):
2056 """Close the file."""
2057 if hasattr(self, '_file'):
2058 try:
2059 if hasattr(self._file, 'close'):
2060 self._file.close()
2061 finally:
2062 del self._file
2063
2064 def _read(self, size, read_method):
2065 """Read size bytes using read_method."""

Callers 1

__exit__Method · 0.95

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected