threads and exception in wxPython

Josiah Carlson jcarlson at
Tue Nov 2 18:18:34 CET 2004

Zunbeltz Izaola <zunbeltz at> wrote:
> I've an wxPython windows that creates a thread. An object of this
> thread raised an exception and i want to cach it in the main thread,
> that of the windows (I want this becouse the first implementation
> doesn't use thread). I know that exception can not be pass between 
> thread.
> I've read something about wraping the run() method of the threaded 
> object in a try/except block and save the exception for inspection ,
> but i don't know how to implement it. Can you give me and advice?

from StringIO import StringIO
import traceback
import Queue

traceback_queue = Queue.Queue()

    def run(self):
            tb = StringIO()

 - Josiah

More information about the Python-list mailing list