Better error messaging in PIL.image.fromarray

This commit is contained in:
pwohlhart 2019-10-29 10:12:03 -07:00 committed by GitHub
parent bb1fc75e55
commit 47691906df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2633,7 +2633,7 @@ def fromarray(obj, mode=None):
typekey = (1, 1) + shape[2:], arr["typestr"]
mode, rawmode = _fromarray_typemap[typekey]
except KeyError:
raise TypeError("Cannot handle this data type")
raise TypeError("Cannot handle this data type: %s, %s" % typekey)
else:
rawmode = mode
if mode in ["1", "L", "I", "P", "F"]: