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

Method close

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

Source from the content-addressed store, hash-verified

608 self._patchheader()
609
610 def close(self):
611 try:
612 if self._file:
613 self._ensure_header_written(0)
614 if self._datalength != self._datawritten:
615 self._patchheader()
616 self._file.flush()
617 finally:
618 self._file = None
619 file = self._i_opened_the_file
620 if file:
621 self._i_opened_the_file = None
622 file.close()
623
624 #
625 # 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