where is the PyString_AsString in Python 3.0?

Stefan Behnel stefan_ml at behnel.de
Sun Mar 8 19:09:55 CET 2009


BigHand wrote:
> I know that there is no PyString_AsString in Python3.0,
> could you guys give me instruction about how can I do with the
> following ?
> 
> PyObject *exc_type = NULL, *exc_value = NULL, *exc_tb = NULL;
> PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
> 
> how do I transfer the exc_type in a char* ?

Are you sure you want the exc_type and not the exc_value? The only major
thing I'd do with the type of an exception is to let Python check for it
using PyErr_ExceptionMatches().

Stefan



More information about the Python-list mailing list