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

Method close

tools/python-3.11.9-amd64/Lib/_pyio.py:412–421  ·  view source on GitHub ↗

Flush and close the IO object. This method has no effect if the file is already closed.

(self)

Source from the content-addressed store, hash-verified

410 __closed = False
411
412 def close(self):
413 """Flush and close the IO object.
414
415 This method has no effect if the file is already closed.
416 """
417 if not self.__closed:
418 try:
419 self.flush()
420 finally:
421 self.__closed = True
422
423 def __del__(self):
424 """Destructor. Calls close()."""

Callers 10

__del__Method · 0.95
__exit__Method · 0.95
openFunction · 0.45
closeMethod · 0.45
closeMethod · 0.45
closeMethod · 0.45
closeMethod · 0.45
__init__Method · 0.45
closeMethod · 0.45
closeMethod · 0.45

Calls 1

flushMethod · 0.95

Tested by

no test coverage detected