Skip to content

Commit 30f4fac

Browse files
committed
Make get_namespace() raise TypeError instead of ValueError
Fixes #26.
1 parent e7e1fb5 commit 30f4fac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

array_api_compat/common/_helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ def get_namespace(*xs, _use_compat=True):
8484
namespaces.add(torch)
8585
else:
8686
# TODO: Support Python scalars?
87-
raise ValueError("The input is not a supported array type")
87+
raise TypeError("The input is not a supported array type")
8888

8989
if not namespaces:
90-
raise ValueError("Unrecognized array input")
90+
raise TypeError("Unrecognized array input")
9191

9292
if len(namespaces) != 1:
93-
raise ValueError(f"Multiple namespaces for array inputs: {namespaces}")
93+
raise TypeError(f"Multiple namespaces for array inputs: {namespaces}")
9494

9595
xp, = namespaces
9696

0 commit comments

Comments
 (0)