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

Method ensure_closed

Lib/test/test_interpreters/utils.py:389–393  ·  view source on GitHub ↗
(fd)

Source from the content-addressed store, hash-verified

387
388 def pipe(self):
389 def ensure_closed(fd):
390 try:
391 os.close(fd)
392 except OSError:
393 pass
394 r, w = os.pipe()
395 self.addCleanup(lambda: ensure_closed(r))
396 self.addCleanup(lambda: ensure_closed(w))

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected