mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
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
1 changed files with 2 additions and 0 deletions
|
|
@ -47,6 +47,8 @@ Py_InitModule4(char *name, PyMethodDef *methods, char *doc,
|
||||||
{
|
{
|
||||||
PyObject *m, *d, *v;
|
PyObject *m, *d, *v;
|
||||||
PyMethodDef *ml;
|
PyMethodDef *ml;
|
||||||
|
if (!Py_IsInitialized())
|
||||||
|
Py_FatalError("Interpreter not initialized (version mismatch?)");
|
||||||
if (module_api_version != PYTHON_API_VERSION)
|
if (module_api_version != PYTHON_API_VERSION)
|
||||||
fprintf(stderr, api_version_warning,
|
fprintf(stderr, api_version_warning,
|
||||||
name, PYTHON_API_VERSION, name, module_api_version);
|
name, PYTHON_API_VERSION, name, module_api_version);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue