Add more descriptive error message to _prepare_colorarray

This commit is contained in:
Juan Nunez-Iglesias
2013-03-14 18:52:30 +11:00
parent 620210025f
commit 30636428db
+2 -1
View File
@@ -130,7 +130,8 @@ def _prepare_colorarray(arr):
arr = np.asanyarray(arr)
if arr.ndim not in [3, 4] or arr.shape[-1] != 3:
msg = "the input array must be have a shape == (.., ..,[ ..,] 3))"
msg = ("the input array must be have a shape == (.., ..,[ ..,] 3)), " +
"got (" + (", ".join(map(str, arr.shape))) + ")")
raise ValueError(msg)
return dtype.img_as_float(arr)