Check from C that Interpreter is running

Discussion in 'Python' started by Florian Schulze, Jul 22, 2003.

  1. 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
    Florian Schulze, Jul 22, 2003
    #1
    1. Advertising

  2. Florian Schulze <> writes:

    > 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

    --
    The proponent of the PEP shall be placed in a gladiatorial arena
    together with half a dozen hungry lions, and permitted to debate
    the merits of the proposal with them.
    -- Greg Ewing, comp.lang.python
    Michael Hudson, Jul 22, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rbt
    Replies:
    8
    Views:
    361
  2. Raphael Zulliger
    Replies:
    3
    Views:
    597
    Raphael Zulliger
    May 26, 2005
  3. Replies:
    3
    Views:
    746
    Ziga Seilnacht
    Jan 3, 2007
  4. Replies:
    3
    Views:
    223
    alex23
    Nov 15, 2008
  5. John Reid
    Replies:
    0
    Views:
    235
    John Reid
    Jul 27, 2010
Loading...

Share This Page