(
search_dir, prefix, python_version, host_platform, target_triple
)
| 139 | |
| 140 | |
| 141 | def 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 | |
| 162 | def write_if_different(p: pathlib.Path, data: bytes): |
nothing calls this directly
no outgoing calls
no test coverage detected