Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 9, 2024
1 parent 18a1828 commit e74d7bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/virtualenv/util/path/_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/activation/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e74d7bc

Please sign in to comment.