mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
prefer sys.platform over os.name when checking for windows OS
This commit is contained in:
parent
2822de9aa6
commit
5ce4a549d3
8 changed files with 13 additions and 10 deletions
|
|
@ -48,7 +48,7 @@ def _read_pyvenv_cfg(filename: str) -> dict[str, str]:
|
|||
|
||||
def bin_dir(venv: str) -> str:
|
||||
"""On windows there's a different directory for the virtualenv"""
|
||||
bin_part = 'Scripts' if os.name == 'nt' else 'bin'
|
||||
bin_part = 'Scripts' if sys.platform == 'win32' else 'bin'
|
||||
return os.path.join(venv, bin_part)
|
||||
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ def norm_version(version: str) -> str | None:
|
|||
elif _sys_executable_matches(version): # virtualenv defaults to our exe
|
||||
return None
|
||||
|
||||
if os.name == 'nt': # pragma: no cover (windows)
|
||||
if sys.platform == 'win32': # pragma: no cover (windows)
|
||||
version_exec = _find_by_py_launcher(version)
|
||||
if version_exec:
|
||||
return version_exec
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue