Skip to content

Commit ab28510

Browse files
committed
Only raise on cuda.bindings modules
1 parent 57dafb4 commit ab28510

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cuda_bindings/tests/utils/check_cyclical_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def import_hook(name, globals=None, locals=None, fromlist=(), *args, **kwargs):
1818
"""Approximate a custom import system that does not allow import cycles."""
1919

2020
stack_entry = (tuple(fromlist) if fromlist is not None else None, name)
21-
if stack_entry in import_stack:
21+
if stack_entry in import_stack and name.startswith("cuda.bindings."):
2222
raise ImportError(f"Import cycle detected: {stack_entry}, stack: {import_stack}")
2323
import_stack.append(stack_entry)
2424
res = orig_import(name, globals, locals, fromlist, *args, **kwargs)

0 commit comments

Comments
 (0)