Make db modules' error classes inherit IOError.

Stop dbm from importing every dbm module when imported.
This commit is contained in:
Georg Brandl 2008-05-28 08:43:17 +00:00
parent e81f5ef1eb
commit b17acad68e
5 changed files with 50 additions and 51 deletions

View file

@ -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);