Fredrik Lundh wrote: > > gordon wrote: > > initXXX() (normally) calls Py_InitModule4, so it would be the > > one in whatever XXXmodule loaded. > > exactly my point... > > so, would this work? Hmm, as I see it this patch would have to be in 1.5.2 to be of any use for the problem mentioned in the subject line: the 1.5 extension links against python15.dll and thus calls the Py_InitModule() of that DLL, not the one in python20.dll which would have the logic below. Anyway, it's a good start for future versions of Python. > Index: Python/modsupport.c > =================================================================== > RCS file: /cvsroot/python/python/dist/src/Python/modsupport.c,v > retrieving revision 2.48 > diff -u -r2.48 modsupport.c > --- Python/modsupport.c 2000/07/09 03:09:56 2.48 > +++ Python/modsupport.c 2000/07/18 07:55:03 > @@ -51,6 +51,8 @@ > { > 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); > > "Fatal Python error: Interpreter not initialized" might not be too helpful, > but it's surely better than "PyThreadState_Get: no current thread"... -- Marc-Andre Lemburg ______________________________________________________________________ Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4