mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-14 13:00:10 -06:00
Use a more specific hook shebang now that it can't be python 2
This commit is contained in:
@@ -56,8 +56,8 @@ def shebang() -> str:
|
||||
# Homebrew/homebrew-core#35825: be more timid about appropriate `PATH`
|
||||
path_choices = [p for p in os.defpath.split(os.pathsep) if p]
|
||||
exe_choices = [
|
||||
'python{}'.format('.'.join(str(v) for v in sys.version_info[:i]))
|
||||
for i in range(3)
|
||||
f'python{sys.version_info[0]}.{sys.version_info[1]}',
|
||||
f'python{sys.version_info[0]}',
|
||||
]
|
||||
for path, exe in itertools.product(path_choices, exe_choices):
|
||||
if os.path.exists(os.path.join(path, exe)):
|
||||
|
||||
Reference in New Issue
Block a user