How to suppress exception printing to console?

Qi no at no.no
Thu May 31 03:57:08 EDT 2012


Hi guys,

I have an application that embedding Python into C++.
When any exception occurred in C++ code, PyErr_SetString will
be called to propagate the exception to Python.

The problem is, some unit tests trigger exception on intention.
So it's OK to have the exceptions. But Python will still print
the exception to console, polluting the unit test output.

My question is, is there any way to disable exception reporting
to console from either C++ or Python code?


Thanks


-- 
WQ



More information about the Python-list mailing list