mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-02 12:13:26 +03:00
Set up Sane error object as exception instead of string
String exceptions don't work anymore.
This commit is contained in:
parent
e84cc92036
commit
fb2ccb15a7
|
@ -1304,7 +1304,7 @@ init_sane(void)
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
PyObject *d = PyModule_GetDict(m);
|
PyObject *d = PyModule_GetDict(m);
|
||||||
ErrorObject = PyBytes_FromString("_sane.error");
|
ErrorObject = PyErr_NewException("_sane.error", NULL, NULL);
|
||||||
PyDict_SetItemString(d, "error", ErrorObject);
|
PyDict_SetItemString(d, "error", ErrorObject);
|
||||||
|
|
||||||
insint(d, "INFO_INEXACT", SANE_INFO_INEXACT);
|
insint(d, "INFO_INEXACT", SANE_INFO_INEXACT);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user