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

Method close

tools/python-3.11.9-amd64/Lib/_pyio.py:1329–1342  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1327 return _BufferedIOMixin.seek(self, pos, whence)
1328
1329 def close(self):
1330 with self._write_lock:
1331 if self.raw is None or self.closed:
1332 return
1333 # We have to release the lock and call self.flush() (which will
1334 # probably just re-take the lock) in case flush has been overridden in
1335 # a subclass or the user set self.flush to something. This is the same
1336 # behavior as the C implementation.
1337 try:
1338 # may raise BlockingIOError or BrokenPipeError etc
1339 self.flush()
1340 finally:
1341 with self._write_lock:
1342 self.raw.close()
1343
1344
1345class BufferedRWPair(BufferedIOBase):

Callers

nothing calls this directly

Calls 2

flushMethod · 0.95
closeMethod · 0.45

Tested by

no test coverage detected