Skip to content

Commit b779d0d

Browse files
committed
build: narrow except to only catch cuda.pathfinder-not-found
Made-with: Cursor
1 parent 5a06d6f commit b779d0d

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

cuda_bindings/build_hooks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ def _import_get_cuda_path_or_home():
4141
"""
4242
try:
4343
import cuda.pathfinder
44-
except ModuleNotFoundError:
44+
except ModuleNotFoundError as exc:
45+
if exc.name != "cuda.pathfinder":
46+
raise
4547
import cuda
4648

4749
for p in sys.path:

cuda_core/build_hooks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def _import_get_cuda_path_or_home():
3636
"""
3737
try:
3838
import cuda.pathfinder
39-
except ModuleNotFoundError:
39+
except ModuleNotFoundError as exc:
40+
if exc.name != "cuda.pathfinder":
41+
raise
4042
import cuda
4143

4244
for p in sys.path:

0 commit comments

Comments
 (0)