Skip to content

Commit da59476

Browse files
Changed TypeError wording per PR feedback
1 parent aadb6b4 commit da59476

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dpctl/tensor/_usmarray.pyx

+4-3
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,11 @@ cdef class usm_ndarray:
191191
try:
192192
<Py_ssize_t> shape
193193
shape = [shape, ]
194-
except Exception:
194+
except Exception as e:
195195
raise TypeError(
196-
"Argument shape must be a list or a tuple."
197-
)
196+
"Argument shape must a non-negative integer, "
197+
"or a list/tuple of such integers."
198+
) from e
198199
nd = len(shape)
199200
if dtype is None:
200201
if isinstance(buffer, (dpmem._memory._Memory, usm_ndarray)):

0 commit comments

Comments
 (0)