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

Method __del__

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

Destructor. Calls close().

(self)

Source from the content-addressed store, hash-verified

421 self.__closed = True
422
423 def __del__(self):
424 """Destructor. Calls close()."""
425 try:
426 closed = self.closed
427 except AttributeError:
428 # If getting closed fails, then the object is probably
429 # in an unusable state, so ignore.
430 return
431
432 if closed:
433 return
434
435 if _IOBASE_EMITS_UNRAISABLE:
436 self.close()
437 else:
438 # The try/except block is in case this is called at program
439 # exit time, when it's possible that globals have already been
440 # deleted, and then the close() call might fail. Since
441 # there's nothing we can do about such failures and they annoy
442 # the end users, we suppress the traceback.
443 try:
444 self.close()
445 except:
446 pass
447
448 ### Inquiries ###
449

Callers

nothing calls this directly

Calls 1

closeMethod · 0.95

Tested by

no test coverage detected