diff --git a/python/libwmfs.c b/python/libwmfs.c index f410cbc..bfd79dc 100644 --- a/python/libwmfs.c +++ b/python/libwmfs.c @@ -92,9 +92,9 @@ wmfs_init(PyObject *self, PyObject *args) /* Else, exit. */ if(!ret) { - fprintf(stderr, "WMFS is not running.\n"); XFree(ret); - exit(EXIT_FAILURE); + PyErr_SetString(WmfsInitError, "WMFS not running?"); + return NULL; } XFree(ret); @@ -189,10 +189,10 @@ initwmfs(void) if(m == NULL) return; - WmfsInitError = PyErr_NewException("wmfs.error", NULL, NULL); + WmfsInitError = PyErr_NewException("wmfs.WmfsInitError", NULL, NULL); Py_INCREF(WmfsInitError); - PyModule_AddObject(m, "error", WmfsInitError); + PyModule_AddObject(m, "WmfsInitError", WmfsInitError); } int