Mercurial > cpython-lru_cache-weakref
diff Modules/structmodule.c @ 36324:1af7f719ed28 legacy-trunk
Check return result from Py_InitModule*(). This API can fail.
Probably should be backported.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Thu, 19 Jan 2006 06:09:39 +0000 |
| parents | 8a3d7f9f02cc |
| children | 9f3f87e920a6 |
line wrap: on
line diff
--- a/Modules/structmodule.c Wed Jan 18 20:04:02 2006 +0000 +++ b/Modules/structmodule.c Thu Jan 19 06:09:39 2006 +0000 @@ -1278,6 +1278,8 @@ /* Create the module and add the functions */ m = Py_InitModule4("struct", struct_methods, struct__doc__, (PyObject*)NULL, PYTHON_API_VERSION); + if (m == NULL) + return; /* Add some symbolic constants to the module */ if (StructError == NULL) {
