MCPcopy Index your code
hub / github.com/RustPython/RustPython / close

Method close

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

Close the file.

(self)

Source from the content-addressed store, hash-verified

2046 self._pos = self._file.tell()
2047
2048 def close(self):
2049 """Close the file."""
2050 if hasattr(self, '_file'):
2051 try:
2052 if hasattr(self._file, 'close'):
2053 self._file.close()
2054 finally:
2055 del self._file
2056
2057 def _read(self, size, read_method):
2058 """Read size bytes using read_method."""

Callers 1

__exit__Method · 0.95

Calls 2

hasattrFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected