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

Function _norm

pre_commit/languages/python.py:86–91  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

84
85def _find_by_sys_executable() -> str | None:
86 def _norm(path: str) -> str | None:
87 _, exe = os.path.split(path.lower())
88 exe, _, _ = exe.partition('.exe')
89 if exe not in {'python', 'pythonw'} and find_executable(exe):
90 return exe
91 return None
92
93 # On linux, I see these common sys.executables:
94 #

Callers 1

_find_by_sys_executableFunction · 0.70

Calls 1

find_executableFunction · 0.90

Tested by

no test coverage detected