diff options
Diffstat (limited to 'Modules/imageop.c')
-rw-r--r-- | Modules/imageop.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/imageop.c b/Modules/imageop.c index 007c83e..049908d 100644 --- a/Modules/imageop.c +++ b/Modules/imageop.c @@ -752,8 +752,7 @@ initimageop() PyObject *m, *d; m = Py_InitModule("imageop", imageop_methods); d = PyModule_GetDict(m); - ImageopError = PyString_FromString("imageop.error"); - if ( ImageopError == NULL || - PyDict_SetItemString(d,"error",ImageopError) ) - Py_FatalError("can't define imageop.error"); + ImageopError = PyErr_NewException("imageop.error", NULL, NULL); + if (ImageopError != NULL) + PyDict_SetItemString(d, "error", ImageopError); } |