From e74d7bc28b9f6a3b2336716d97255d544f67db37 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 20:13:01 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/virtualenv/util/path/_win.py | 8 ++++---- tests/unit/activation/conftest.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/virtualenv/util/path/_win.py b/src/virtualenv/util/path/_win.py index aa67ca770..6404cda64 100644 --- a/src/virtualenv/util/path/_win.py +++ b/src/virtualenv/util/path/_win.py @@ -6,13 +6,13 @@ def get_short_path_name(long_name): import ctypes # noqa: PLC0415 from ctypes import wintypes # noqa: PLC0415 - _GetShortPathNameW = ctypes.windll.kernel32.GetShortPathNameW # noqa: N806 - _GetShortPathNameW.argtypes = [wintypes.LPCWSTR, wintypes.LPWSTR, wintypes.DWORD] - _GetShortPathNameW.restype = wintypes.DWORD + GetShortPathNameW = ctypes.windll.kernel32.GetShortPathNameW # noqa: N806 + GetShortPathNameW.argtypes = [wintypes.LPCWSTR, wintypes.LPWSTR, wintypes.DWORD] + GetShortPathNameW.restype = wintypes.DWORD output_buf_size = 0 while True: output_buf = ctypes.create_unicode_buffer(output_buf_size) - needed = _GetShortPathNameW(long_name, output_buf, output_buf_size) + needed = GetShortPathNameW(long_name, output_buf, output_buf_size) if output_buf_size >= needed: return output_buf.value output_buf_size = needed diff --git a/tests/unit/activation/conftest.py b/tests/unit/activation/conftest.py index e320038ea..2d53d540c 100644 --- a/tests/unit/activation/conftest.py +++ b/tests/unit/activation/conftest.py @@ -212,8 +212,8 @@ def __call__(self, monkeypatch, tmp_path): stderr=subprocess.PIPE, env=env, ) - _out, _err = process.communicate() - err = _err.decode("utf-8") + _out, err_ = process.communicate() + err = err_.decode("utf-8") assert process.returncode assert self.non_source_fail_message in err