Use a more specific hook shebang now that it can't be python 2

This commit is contained in:
Anthony Sottile
2020-01-16 09:57:41 -08:00
parent 31c4c37156
commit 2f51b9da1c

View File

@@ -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)):