From 2f51b9da1c526ee6ed6a317d2dfd259d0072dbae Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 16 Jan 2020 09:57:41 -0800 Subject: [PATCH] Use a more specific hook shebang now that it can't be python 2 --- pre_commit/commands/install_uninstall.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pre_commit/commands/install_uninstall.py b/pre_commit/commands/install_uninstall.py index 7aeba228..a9c46d90 100644 --- a/pre_commit/commands/install_uninstall.py +++ b/pre_commit/commands/install_uninstall.py @@ -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)):