Hi all,
I am using Python 2.6 and with the following code I expect a different result:

from test.test_support import captured_output
with captured_output("stderr") as stderr:
    def g():
        try:
            g()
        except RuntimeError,e:
            pass
    g()
    print stderr.getvalue()

I expect the ignored exceptions to be printed into the StringIO object stderr. With this code there are no warnings on the command line, but getvalue() returns nothing.

I looked a little into Python and the warnings are printed from PyErr_WriteUnraisable to sys.stderr.

Is this code supposed to work as I expect it or am I missing something?
thanks,
Jan
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to