From 9bdce088c8304b23cd8ae161e99872db81065c02 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 17 Jun 2019 07:54:38 -0700 Subject: [PATCH] Use sys.executable if it matches on posix as well --- pre_commit/languages/python.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pre_commit/languages/python.py b/pre_commit/languages/python.py index ca114670..5d48fb89 100644 --- a/pre_commit/languages/python.py +++ b/pre_commit/languages/python.py @@ -104,11 +104,11 @@ def _sys_executable_matches(version): def norm_version(version): - if os.name == 'nt': # pragma: no cover (windows) - # first see if our current executable is appropriate - if _sys_executable_matches(version): - return sys.executable + # first see if our current executable is appropriate + if _sys_executable_matches(version): + return sys.executable + if os.name == 'nt': # pragma: no cover (windows) version_exec = _find_by_py_launcher(version) if version_exec: return version_exec