diff --git a/Python/modsupport.c b/Python/modsupport.c index 7dbfe1ce7d4..dacc1a0a815 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -47,6 +47,8 @@ Py_InitModule4(char *name, PyMethodDef *methods, char *doc, { PyObject *m, *d, *v; PyMethodDef *ml; + if (!Py_IsInitialized()) + Py_FatalError("Interpreter not initialized (version mismatch?)"); if (module_api_version != PYTHON_API_VERSION) fprintf(stderr, api_version_warning, name, PYTHON_API_VERSION, name, module_api_version);