Skip to content

Commit f985d6d

Browse files
committed
Fix Windows pre-commit checks
1 parent 86dcf9c commit f985d6d

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

‎cuda_pathfinder/cuda/pathfinder/_binaries/find_nvidia_binary_utility.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ def _windows_installed_nsight_root(product: str) -> str | None:
106106
with winreg.OpenKey(product_key, current_version, 0, access) as version_key:
107107
install_root, _ = winreg.QueryValueEx(version_key, None)
108108
except FileNotFoundError as exc:
109-
raise RuntimeError(
110-
f"Incomplete Nsight {product!r} registry registration at {product_key_path!r}"
111-
) from exc
109+
raise RuntimeError(f"Incomplete Nsight {product!r} registry registration at {product_key_path!r}") from exc
112110

113111
if not isinstance(install_root, str) or not install_root.strip():
114112
raise RuntimeError(

‎cuda_pathfinder/cuda/pathfinder/_utils/windows_arch.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _windows_native_machine() -> int | None:
5959

6060
try:
6161
# These ctypes attributes are absent from the type stubs on non-Windows hosts.
62-
kernel32 = ctypes.WinDLL("kernel32", use_last_error=True) # type: ignore[attr-defined]
62+
kernel32 = ctypes.WinDLL("kernel32", use_last_error=True) # type: ignore[attr-defined, unused-ignore]
6363
except OSError as exc:
6464
raise RuntimeError("Failed to load kernel32 while detecting the native Windows architecture") from exc
6565

@@ -85,8 +85,8 @@ def _windows_native_machine() -> int | None:
8585
ctypes.byref(process_machine),
8686
ctypes.byref(native_machine),
8787
):
88-
error_code = ctypes.get_last_error() # type: ignore[attr-defined]
89-
error = ctypes.WinError(error_code) # type: ignore[attr-defined]
88+
error_code = ctypes.get_last_error() # type: ignore[attr-defined, unused-ignore]
89+
error = ctypes.WinError(error_code) # type: ignore[attr-defined, unused-ignore]
9090
raise RuntimeError(
9191
f"IsWow64Process2 failed while detecting the native Windows architecture "
9292
f"(Windows error {error_code}): {error}"

0 commit comments

Comments
 (0)