Although I have set Jython interpreter's output stream (with PyFile object), this setting is ignored when an exception is thrown while processing code in another thread:

import threading

def foo():
    print "This is ok"
    int("bar")

threading.Timer(5, foo).start()

Is there any way how to capture it? Now it messes up the Linux console. I need to capture any error information and display it to the user in more controlled manner.