From 413407f103b59568b7fc0ef6036805521cfddbff Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 4 Aug 2000 14:00:14 +0000 Subject: Add a test that Py_IsInitialized() in Py_InitModule4(). See python-dev discussion. This should catch future version incompatibilities on Windows. Alas, this doesn't help for 1.5 vs. 1.6; but it will help for 1.6 vs. 2.0. --- Python/modsupport.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Python/modsupport.c b/Python/modsupport.c index 7dbfe1c..dacc1a0 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); -- cgit v0.12