MCPcopy Create free account
hub / github.com/astral-sh/python-build-standalone / get_target_support_file

Function get_target_support_file

pythonbuild/utils.py:141–159  ·  view source on GitHub ↗
(
    search_dir, prefix, python_version, host_platform, target_triple
)

Source from the content-addressed store, hash-verified

139
140
141def get_target_support_file(
142 search_dir, prefix, python_version, host_platform, target_triple
143):
144 candidates = [
145 search_dir / ("%s.%s.%s" % (prefix, python_version, target_triple)),
146 search_dir / ("%s.%s.%s" % (prefix, python_version, host_platform)),
147 ]
148
149 for path in candidates:
150 if path.exists():
151 return path
152
153 raise Exception(
154 "Could not find support file %s for (%s, %s, %s)",
155 prefix,
156 python_version,
157 host_platform,
158 target_triple,
159 )
160
161
162def write_if_different(p: pathlib.Path, data: bytes):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected