From 0a8d35fcc49d6dc171cc12d600d93f3931b05efb Mon Sep 17 00:00:00 2001 From: "Brian J. Crowell" Date: Wed, 9 Jan 2013 23:45:17 -0600 Subject: [PATCH] Set up Sane error object as exception instead of string String exceptions don't work anymore. --- Sane/_sane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sane/_sane.c b/Sane/_sane.c index 2939371a5..d45e6a346 100644 --- a/Sane/_sane.c +++ b/Sane/_sane.c @@ -1304,7 +1304,7 @@ init_sane(void) /* Add some symbolic constants to the module */ PyObject *d = PyModule_GetDict(m); - ErrorObject = PyBytes_FromString("_sane.error"); + ErrorObject = PyErr_NewException("_sane.error", NULL, NULL); PyDict_SetItemString(d, "error", ErrorObject); insint(d, "INFO_INEXACT", SANE_INFO_INEXACT);