Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > tracebacks in embedded python

Reply
Thread Tools

tracebacks in embedded python

 
 
=?ISO-8859-1?Q?Mike_M=FCller?=
Guest
Posts: n/a
 
      07-09-2003
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
 
Reply With Quote
 
 
 
 
Thomas Heller
Guest
Posts: n/a
 
      07-09-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: backporting PEP 3134 "Exception Chaining and Embedded Tracebacks"to Python 2.7 Demian Brecht Python 0 02-19-2013 08:56 PM
backporting PEP 3134 "Exception Chaining and Embedded Tracebacks" toPython 2.7 Piotr Dobrogost Python 0 02-19-2013 08:54 PM
getting tracebacks from traceback objects Michael P. Soulier Python 1 06-24-2005 10:56 AM
How should threads be terminated? (related to 'Help with thread related tracebacks') Maxwell Hammer Python 7 06-18-2005 04:20 PM
Help with thread related tracebacks Maxwell Hammer Python 0 06-16-2005 05:50 AM



Advertisments