Mercurial > cpython-lru_cache-weakref
diff Python/import.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 | ea083efdc96c |
| children | 7fdc639bc5b4 |
line wrap: on
line diff
--- a/Python/import.c Wed Jan 18 20:04:02 2006 +0000 +++ b/Python/import.c Thu Jan 19 06:09:39 2006 +0000 @@ -2817,6 +2817,8 @@ m = Py_InitModule4("imp", imp_methods, doc_imp, NULL, PYTHON_API_VERSION); + if (m == NULL) + goto failure; d = PyModule_GetDict(m); if (setint(d, "SEARCH_ERROR", SEARCH_ERROR) < 0) goto failure;
