MCPcopy Index your code
hub / github.com/RustPython/RustPython / close

Method close

Lib/logging/__init__.py:1221–1240  ·  view source on GitHub ↗

Closes the stream.

(self)

Source from the content-addressed store, hash-verified

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

Callers 3

test_delayMethod · 0.95

Calls 3

hasattrFunction · 0.85
flushMethod · 0.45
closeMethod · 0.45

Tested by 3

test_delayMethod · 0.76