Commit 5289346e authored by Guido van Rossum's avatar Guido van Rossum

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.
parent ad51f8c6
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment