summaryrefslogtreecommitdiffstats
path: root/Python/modsupport.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-08-04 14:00:14 (GMT)
committerGuido van Rossum <guido@python.org>2000-08-04 14:00:14 (GMT)
commit413407f103b59568b7fc0ef6036805521cfddbff (patch)
treefa1ab88bd957e667e9a1c0e374b5134e0ff1498f /Python/modsupport.c
parentb9fa0a843e239bcdaecbe16aaa508e9e25b5afce (diff)
downloadcpython-413407f103b59568b7fc0ef6036805521cfddbff.zip
cpython-413407f103b59568b7fc0ef6036805521cfddbff.tar.gz
cpython-413407f103b59568b7fc0ef6036805521cfddbff.tar.bz2
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.
Diffstat (limited to 'Python/modsupport.c')
-rw-r--r--Python/modsupport.c2
1 files changed, 2 insertions, 0 deletions
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);