Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2f51b9d

Browse files
committed
Use a more specific hook shebang now that it can't be python 2
1 parent 31c4c37 commit 2f51b9d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pre_commit/commands/install_uninstall.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def shebang() -> str:
5656
# Homebrew/homebrew-core#35825: be more timid about appropriate `PATH`
5757
path_choices = [p for p in os.defpath.split(os.pathsep) if p]
5858
exe_choices = [
59-
'python{}'.format('.'.join(str(v) for v in sys.version_info[:i]))
60-
for i in range(3)
59+
f'python{sys.version_info[0]}.{sys.version_info[1]}',
60+
f'python{sys.version_info[0]}',
6161
]
6262
for path, exe in itertools.product(path_choices, exe_choices):
6363
if os.path.exists(os.path.join(path, exe)):

0 commit comments

Comments
 (0)