Check from C that Interpreter is running

F

Florian Schulze

Hi!

I want to check from C that the Python Interpreter is still running and
it's save to call things like PySys_GetObject, PyFile_WriteString etc. I
need this in a C function which might be called during shutdown in a
program embedding Python. Currently I get this error:

Fatal Python error: PyThreadState_Get: no current thread
Abort!

Regards,
Florian
 
M

Michael Hudson

Florian Schulze said:
Hi!

I want to check from C that the Python Interpreter is still running
and it's save to call things like PySys_GetObject, PyFile_WriteString
etc. I need this in a C function which might be called during shutdown
in a program embedding Python. Currently I get this error:

Fatal Python error: PyThreadState_Get: no current thread
Abort!

Py_IsInitialized?

Cheers,
mwh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top