Skip to content

Commit 9f6b6df

Browse files
committed
Handle errors in repr for GpuArrays.
1 parent 8e5f40f commit 9f6b6df

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pygpu/gpuarray.pyx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1978,7 +1978,10 @@ cdef class GpuArray:
19781978
return str(numpy.asarray(self))
19791979

19801980
def __repr__(self):
1981-
return 'gpuarray.' + repr(numpy.asarray(self))
1981+
try:
1982+
return 'gpuarray.' + repr(numpy.asarray(self))
1983+
except Exception:
1984+
return 'gpuarray.array(<content not available>)'
19821985

19831986

19841987

0 commit comments

Comments
 (0)