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

Function _version_info

pre_commit/languages/python.py:28–33  ·  view source on GitHub ↗
(exe: str)

Source from the content-addressed store, hash-verified

26
27@functools.cache
28def _version_info(exe: str) -> str:
29 prog = 'import sys;print(".".join(str(p) for p in sys.version_info))'
30 try:
31 return cmd_output(exe, '-S', '-c', prog)[1].strip()
32 except CalledProcessError:
33 return f'<<error retrieving version from {exe}>>'
34
35
36def _read_pyvenv_cfg(filename: str) -> dict[str, str]:

Callers 1

health_checkFunction · 0.85

Calls 1

cmd_outputFunction · 0.90

Tested by

no test coverage detected