Improved error message for missing packer

It's not that the raw mode does not exist.
There is just no direct conversion.
This commit is contained in:
Arjen Nienhuis 2016-08-07 02:17:16 +02:00
parent 2ecbcce415
commit 124e42ade3

View File

@ -365,7 +365,7 @@ get_packer(ImagingEncoderObject* encoder, const char* mode,
pack = ImagingFindPacker(mode, rawmode, &bits); pack = ImagingFindPacker(mode, rawmode, &bits);
if (!pack) { if (!pack) {
Py_DECREF(encoder); Py_DECREF(encoder);
PyErr_SetString(PyExc_SystemError, "unknown raw mode"); PyErr_Format(PyExc_ValueError, "No packer found from %s to %s", mode, rawmode);
return -1; return -1;
} }