[Python-bugs-list] Py_IsInitialized() crash: "no current thread" (PR#222)

david_albeck@dragonsys.com david_albeck@dragonsys.com
Thu, 2 Mar 2000 12:42:27 -0500 (EST)


Full_Name: David B. Albeck
Version: 1.5.2
OS: Windows NT
Submission from: pluto.dragonsys.com (204.165.63.1)


Py_IsInitialized() crashes if Python is not initialized!

I am running Python embedded in a simple test program written in C++.  
Before making any other Python calls (notably, before calling Py_Initialize()),
it calls Py_IsInitialized().
That crashes with the message:
Fatal Python error: PyThreadState_Get: no current thread

Replacing Py_IsInitialized() with my own function (using a static variable)is my
workaround.

If, after making sure I've already called Py_Initialize(), I then call
Py_IsInitialized(), Py_IsInitialized() works fine (returns True).