summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_dbmmodule.c3
-rw-r--r--Modules/_gdbmmodule.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c
index ddfd4cd759..7e80381db7 100644
--- a/Modules/_dbmmodule.c
+++ b/Modules/_dbmmodule.c
@@ -401,7 +401,8 @@ init_dbm(void) {
return;
d = PyModule_GetDict(m);
if (DbmError == NULL)
- DbmError = PyErr_NewException("_dbm.error", NULL, NULL);
+ DbmError = PyErr_NewException("_dbm.error",
+ PyExc_IOError, NULL);
s = PyUnicode_FromString(which_dbm);
if (s != NULL) {
PyDict_SetItemString(d, "library", s);
diff --git a/Modules/_gdbmmodule.c b/Modules/_gdbmmodule.c
index 6c7581969a..abc8837091 100644
--- a/Modules/_gdbmmodule.c
+++ b/Modules/_gdbmmodule.c
@@ -523,7 +523,7 @@ init_gdbm(void) {
if (m == NULL)
return;
d = PyModule_GetDict(m);
- DbmError = PyErr_NewException("_gdbm.error", NULL, NULL);
+ DbmError = PyErr_NewException("_gdbm.error", PyExc_IOError, NULL);
if (DbmError != NULL) {
PyDict_SetItemString(d, "error", DbmError);
s = PyUnicode_FromString(dbmmodule_open_flags);