diff options
Diffstat (limited to 'Modules/nismodule.c')
-rw-r--r-- | Modules/nismodule.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/nismodule.c b/Modules/nismodule.c index 5866026..cadbad0 100644 --- a/Modules/nismodule.c +++ b/Modules/nismodule.c @@ -370,8 +370,7 @@ initnis () PyObject *m, *d; m = Py_InitModule("nis", nis_methods); d = PyModule_GetDict(m); - NisError = PyString_FromString("nis.error"); - if (NisError == NULL || - PyDict_SetItemString(d, "error", NisError) != 0) - Py_FatalError("Cannot define nis.error"); + NisError = PyErr_NewException("nis.error", NULL, NULL); + if (NisError != NULL) + PyDict_SetItemString(d, "error", NisError); } |