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

Function _close_file

Lib/test/test_interpreters/utils.py:47–56  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

45
46
47def _close_file(file):
48 try:
49 if hasattr(file, 'close'):
50 file.close()
51 else:
52 os.close(file)
53 except OSError as exc:
54 if exc.errno != 9:
55 raise # re-raise
56 # It was closed already.
57
58
59def pack_exception(exc=None):

Callers 2

closeMethod · 0.85
closeMethod · 0.85

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…