MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / close

Method close

tools/python-3.11.9-amd64/Lib/aifc.py:761–780  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

759 self._patchheader()
760
761 def close(self):
762 if self._file is None:
763 return
764 try:
765 self._ensure_header_written(0)
766 if self._datawritten & 1:
767 # quick pad to even size
768 self._file.write(b'\x00')
769 self._datawritten = self._datawritten + 1
770 self._writemarkers()
771 if self._nframeswritten != self._nframes or \
772 self._datalength != self._datawritten or \
773 self._marklength:
774 self._patchheader()
775 finally:
776 # Prevent ref cycles
777 self._convert = None
778 f = self._file
779 self._file = None
780 f.close()
781
782 #
783 # Internal methods.

Callers 2

__del__Method · 0.95
__exit__Method · 0.95

Calls 5

_writemarkersMethod · 0.95
_patchheaderMethod · 0.95
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected