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. Advertisements

  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. Advertisements

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:
    489
  2. Raphael Zulliger
    Replies:
    3
    Views:
    709
    Raphael Zulliger
    May 26, 2005
  3. Rex Eastbourne

    Running Python interpreter in Emacs

    Rex Eastbourne, Jun 23, 2005, in forum: Python
    Replies:
    12
    Views:
    1,016
    Rex Eastbourne
    Jul 2, 2005
  4. Charles Krug
    Replies:
    6
    Views:
    499
    Charles Krug
    Jan 29, 2006
  5. Dirk Runge
    Replies:
    0
    Views:
    445
    Dirk Runge
    Sep 18, 2006
  6. Replies:
    3
    Views:
    1,082
    Ziga Seilnacht
    Jan 3, 2007
  7. Replies:
    3
    Views:
    331
    alex23
    Nov 15, 2008
  8. John Reid
    Replies:
    0
    Views:
    343
    John Reid
    Jul 27, 2010
Loading...