From 47691906df10d0a7bfb485e97ba66475247189fd Mon Sep 17 00:00:00 2001 From: pwohlhart Date: Tue, 29 Oct 2019 10:12:03 -0700 Subject: [PATCH] Better error messaging in PIL.image.fromarray --- src/PIL/Image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 474ca1e88..0c783a428 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -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"]: