[C++-sig] PyErr_Print() as string ?
Pierre Barbier de Reuille
pierre.barbier at cirad.fr
Thu Feb 5 09:48:35 CET 2004
You can redefine sys.stderr to be a StringIO (or any class behaving as a
file...). Then, when you call PyErr_Print() it will "print" the error in
your class ... so it will be in your string.
But this is bot a Boost.Python question, this question should be in a
Python mailing list ...
Pierre
On Wed, 2004-02-04 at 21:02, Fabrizio wrote:
> hi, sorry for my english
>
> i want to get python error as string.
> i try to redirect PyErr_Print() into std::cerr.rdbuf but doesn't work
>
> any idea ?
>
> Thanks in advance.
>
> fabrizio
>
>
>
> ---
>
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.577 / Virus Database: 366 - Release Date: 03/02/2004
>
>
>
>
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
--
Pierre Barbier de Reuille
INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP
Botanique et Bio-informatique de l'Architecture des Plantes
TA40/PSII, Boulevard de la Lironde
34398 MONTPELLIER CEDEX 5, France
tel : (33) 4 67 61 65 77 fax : (33) 4 67 61 56 68
More information about the Cplusplus-sig
mailing list