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.
This commit is contained in:
parent
b9fa0a843e
commit
413407f103
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue