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

Method close

Lib/logging/__init__.py:1224–1243  ·  view source on GitHub ↗

Closes the stream.

(self)

Source from the content-addressed store, hash-verified

1222 StreamHandler.__init__(self, self._open())
1223
1224 def close(self):
1225 """
1226 Closes the stream.
1227 """
1228 with self.lock:
1229 try:
1230 if self.stream:
1231 try:
1232 self.flush()
1233 finally:
1234 stream = self.stream
1235 self.stream = None
1236 if hasattr(stream, "close"):
1237 stream.close()
1238 finally:
1239 # Issue #19523: call unconditionally to
1240 # prevent a handler leak when delay is set
1241 # Also see Issue #42378: we also rely on
1242 # self._closed being set to True there
1243 StreamHandler.close(self)
1244
1245 def _open(self):
1246 """

Callers 3

test_delayMethod · 0.95

Calls 2

flushMethod · 0.45
closeMethod · 0.45

Tested by 3

test_delayMethod · 0.76