mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
pre_commit: prefer pythonX over pythonX.Y
This patch prevent reinstallation of pre-commit hooks or any script generated
by shebang function to just update the script shebang, since the scripts are
not heavily dependent on a specific Python 3 version:
/usr/bin/env: ‘python3.9’: No such file or directory
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
This commit is contained in:
parent
de177e8850
commit
c37446c430
1 changed files with 1 additions and 1 deletions
|
|
@ -59,8 +59,8 @@ def shebang() -> str:
|
|||
py, _ = os.path.splitext(SYS_EXE)
|
||||
else:
|
||||
exe_choices = [
|
||||
f'python{sys.version_info[0]}.{sys.version_info[1]}',
|
||||
f'python{sys.version_info[0]}',
|
||||
f'python{sys.version_info[0]}.{sys.version_info[1]}',
|
||||
]
|
||||
# avoid searching for bare `python` as it's likely to be python 2
|
||||
if SYS_EXE != 'python':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue