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

Method close

tools/python-3.11.9-amd64/Lib/logging/__init__.py:1183–1205  ·  view source on GitHub ↗

Closes the stream.

(self)

Source from the content-addressed store, hash-verified

1181 StreamHandler.__init__(self, self._open())
1182
1183 def close(self):
1184 """
1185 Closes the stream.
1186 """
1187 self.acquire()
1188 try:
1189 try:
1190 if self.stream:
1191 try:
1192 self.flush()
1193 finally:
1194 stream = self.stream
1195 self.stream = None
1196 if hasattr(stream, "close"):
1197 stream.close()
1198 finally:
1199 # Issue #19523: call unconditionally to
1200 # prevent a handler leak when delay is set
1201 # Also see Issue #42378: we also rely on
1202 # self._closed being set to True there
1203 StreamHandler.close(self)
1204 finally:
1205 self.release()
1206
1207 def _open(self):
1208 """

Callers

nothing calls this directly

Calls 4

acquireMethod · 0.45
flushMethod · 0.45
closeMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected