summaryrefslogtreecommitdiffstats
path: root/Modules/gdbmmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/gdbmmodule.c')
-rw-r--r--Modules/gdbmmodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/gdbmmodule.c b/Modules/gdbmmodule.c
index 23ec831..8c870c0 100644
--- a/Modules/gdbmmodule.c
+++ b/Modules/gdbmmodule.c
@@ -432,7 +432,7 @@ initgdbm() {
m = Py_InitModule("gdbm", dbmmodule_methods);
d = PyModule_GetDict(m);
- DbmError = PyString_FromString("gdbm.error");
- if ( DbmError == NULL || PyDict_SetItemString(d, "error", DbmError) )
- Py_FatalError("can't define gdbm.error");
+ DbmError = PyErr_NewException("gdbm.error", NULL, NULL);
+ if (DbmError != NULL)
+ PyDict_SetItemString(d, "error", DbmError);
}