[Dev] Exceptions thrown into wxWidgets

Robin Dunn robin at alldunn.com
Wed Apr 13 18:30:26 PDT 2005


John Anderson wrote:
> I also spend a several days tracking this down this exact problem a few 
> weeks ago. Robin says it is now probably possible to have Python 
> exception travel through C++, but that implementing it would be a big 
> job. Currenly Python exceptions are caught and printed on stderr when 
> the enter C++. As an alternative, I was thinking it would probably 
> pretty easy to generate a dialog when running the debug version of 
> Python, which would allow developers to find problems and testing the 
> debugging version of Chandler not to loose asserts.

One way to do it is to just replace sys.stderr with some class that has 
a write(text) method.  Then it will be called whenever anything (such as 
a traceback) is written to stderr.  From that point you can do whatever 
makes sense with the text, toss it, log it, accumulate it until idle 
time and then display it, etc.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!



More information about the Dev mailing list