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

Function _maybe_open

Lib/zipapp.py:38–43  ·  view source on GitHub ↗
(archive, mode)

Source from the content-addressed store, hash-verified

36
37@contextlib.contextmanager
38def _maybe_open(archive, mode):
39 if isinstance(archive, (str, os.PathLike)):
40 with open(archive, mode) as f:
41 yield f
42 else:
43 yield archive
44
45
46def _write_file_prefix(f, interpreter):

Callers 3

_copy_archiveFunction · 0.85
create_archiveFunction · 0.85
get_interpreterFunction · 0.85

Calls 1

openFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…