
thomas wrote:
+ if (!Py_IsInitialized()) + Py_FatalError("Interpreter not initialized (version
Wasn't there a problem with this, because the 'Py_FatalError()' would be the one in the uninitialized library and thus result in the same tstate error ?
you mean this one: Py_FatalError("PyThreadState_Get: no current thread");
Perhaps it needs a separate error message, that avoids the usual Python cleanup and trickery and just prints the error message and exits ?
void Py_FatalError(char *msg) { fprintf(stderr, "Fatal Python error: %s\n", msg); #ifdef macintosh for (;;); #endif #ifdef MS_WIN32 OutputDebugString("Fatal Python error: "); OutputDebugString(msg); OutputDebugString("\n"); #ifdef _DEBUG DebugBreak(); #endif #endif /* MS_WIN32 */ abort(); } </F>