diff options
Diffstat (limited to 'Modules/structmodule.c')
-rw-r--r-- | Modules/structmodule.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Modules/structmodule.c b/Modules/structmodule.c index ef35bd7..4b01f4b 100644 --- a/Modules/structmodule.c +++ b/Modules/structmodule.c @@ -1298,10 +1298,8 @@ initstruct() /* Add some symbolic constants to the module */ d = PyModule_GetDict(m); - StructError = PyString_FromString("struct.error"); + StructError = PyErr_NewException("struct.error", NULL, NULL); + if (StructError == NULL) + return; PyDict_SetItemString(d, "error", StructError); - - /* Check for errors */ - if (PyErr_Occurred()) - Py_FatalError("can't initialize module struct"); } |