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

Method close

Lib/wave.py:592–604  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

590 self._patchheader()
591
592 def close(self):
593 try:
594 if self._file:
595 self._ensure_header_written(0)
596 if self._datalength != self._datawritten:
597 self._patchheader()
598 self._file.flush()
599 finally:
600 self._file = None
601 file = self._i_opened_the_file
602 if file:
603 self._i_opened_the_file = None
604 file.close()
605
606 #
607 # Internal methods.

Callers 2

__del__Method · 0.95
__exit__Method · 0.95

Calls 4

_patchheaderMethod · 0.95
flushMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected