summaryrefslogtreecommitdiffstats
path: root/Modules/fpetestmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/fpetestmodule.c')
-rw-r--r--Modules/fpetestmodule.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/Modules/fpetestmodule.c b/Modules/fpetestmodule.c
index b568b60..61dd3db 100644
--- a/Modules/fpetestmodule.c
+++ b/Modules/fpetestmodule.c
@@ -178,9 +178,7 @@ void initfpetest(void)
m = Py_InitModule("fpetest", fpetest_methods);
d = PyModule_GetDict(m);
- fpe_error = PyString_FromString("fpetest.error");
- PyDict_SetItemString(d, "error", fpe_error);
-
- if (PyErr_Occurred())
- Py_FatalError("Cannot initialize module fpetest");
+ fpe_error = PyErr_NewException("fpetest.error", NULL, NULL);
+ if (fpe_error != NULL)
+ PyDict_SetItemString(d, "error", fpe_error);
}