MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / _sys_executable_matches

Function _sys_executable_matches

pre_commit/languages/python.py:134–145  ·  view source on GitHub ↗
(version: str)

Source from the content-addressed store, hash-verified

132
133
134def _sys_executable_matches(version: str) -> bool:
135 if version == 'python':
136 return True
137 elif not version.startswith('python'):
138 return False
139
140 try:
141 info = tuple(int(p) for p in version.removeprefix('python').split('.'))
142 except ValueError:
143 return False
144
145 return sys.version_info[:len(info)] == info
146
147
148def norm_version(version: str) -> str | None:

Callers 1

norm_versionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected