tracebacks in embedded python

Discussion in 'Python' started by =?ISO-8859-1?Q?Mike_M=FCller?=, Jul 9, 2003.

  1. When I embed Python into C there is no traceback message on the screen
    after an uncaught exception. Using sys.exc_info() I can print may own
    traceback but I would need to insert try except statements at
    different places. Is there a way to "turn on" traceback writing to
    std.err (that also shows up at the screen)?

    Thanks

    Mike
     
    =?ISO-8859-1?Q?Mike_M=FCller?=, Jul 9, 2003
    #1
    1. Advertising

  2. (Mike Müller) writes:

    > When I embed Python into C there is no traceback message on the screen
    > after an uncaught exception. Using sys.exc_info() I can print may own
    > traceback but I would need to insert try except statements at
    > different places. Is there a way to "turn on" traceback writing to
    > std.err (that also shows up at the screen)?


    You should check the return value of the Python API call for failure.
    Most functions return NULL or -1 on error.
    Then you call PyErr_Print().

    Thomas
     
    Thomas Heller, Jul 9, 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. Maxwell Hammer

    Help with thread related tracebacks

    Maxwell Hammer, Jun 16, 2005, in forum: Python
    Replies:
    0
    Views:
    305
    Maxwell Hammer
    Jun 16, 2005
  2. Maxwell Hammer
    Replies:
    7
    Views:
    649
    Peter Hansen
    Jun 18, 2005
  3. Michael P. Soulier

    getting tracebacks from traceback objects

    Michael P. Soulier, Jun 24, 2005, in forum: Python
    Replies:
    1
    Views:
    379
    Kent Johnson
    Jun 24, 2005
  4. Piotr Dobrogost
    Replies:
    0
    Views:
    86
    Piotr Dobrogost
    Feb 19, 2013
  5. Demian Brecht
    Replies:
    0
    Views:
    132
    Demian Brecht
    Feb 19, 2013
Loading...

Share This Page