Skip to content

Commit 0561a8c

Browse files
Improved exceptions msg
1 parent c09ac88 commit 0561a8c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dpctl/tensor/_usmarray.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ cdef class usm_ndarray:
234234
else:
235235
self._cleanup()
236236
raise ValueError(
237-
"buffer='{}' is not understood. "
237+
("buffer='{}' is not understood. "
238238
"Recognized values are 'device', 'shared', 'host', "
239239
"an instance of `MemoryUSM*` object, or a usm_ndarray"
240-
"".format(buffer))
240+
"").format(buffer))
241241
elif isinstance(buffer, usm_ndarray):
242242
_buffer = buffer.usm_data
243243
else:
@@ -246,8 +246,8 @@ cdef class usm_ndarray:
246246
if (_offset + ary_min_displacement < 0 or
247247
(_offset + ary_max_displacement + 1) * itemsize > _buffer.nbytes):
248248
self._cleanup()
249-
raise ValueError("buffer='{}' can not accomodate the requested "
250-
"array.".format(buffer))
249+
raise ValueError(("buffer='{}' can not accomodate "
250+
"the requested array.").format(buffer))
251251
self.base_ = _buffer
252252
self.data_ = (<char *> (<size_t> _buffer._pointer)) + itemsize * _offset
253253
self.shape_ = shape_ptr

0 commit comments

Comments
 (0)