Skip to content

Commit 01aa8d1

Browse files
committed
fix: SIM102 - combine nested if statements in /usr/local/cuda fallback
1 parent 2cc9161 commit 01aa8d1

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

cuda_pathfinder/cuda/pathfinder/_headers/find_nvidia_headers.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,12 @@ def _find_ctk_header_directory(libname: str) -> LocatedHeaderDir | None:
108108
return LocatedHeaderDir(abs_path=result, found_via="CUDA_HOME")
109109

110110
# Fallback: typical system install path (matches CuPy's get_cuda_path())
111-
if not IS_WINDOWS and os.path.exists('/usr/local/cuda'):
112-
if result := _locate_based_on_ctk_layout(libname, h_basename, '/usr/local/cuda'):
113-
return LocatedHeaderDir(abs_path=result, found_via="system_default")
111+
if (
112+
not IS_WINDOWS
113+
and os.path.exists("/usr/local/cuda")
114+
and (result := _locate_based_on_ctk_layout(libname, h_basename, "/usr/local/cuda"))
115+
):
116+
return LocatedHeaderDir(abs_path=result, found_via="system_default")
114117

115118
return None
116119

0 commit comments

Comments
 (0)