mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
Make db modules' error classes inherit IOError.
Stop dbm from importing every dbm module when imported.
This commit is contained in:
parent
e81f5ef1eb
commit
b17acad68e
5 changed files with 50 additions and 51 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue