traceback over C API - still not working...

2007-10-20 Thread Sami Vaisanen
This is becoming utterly painful process I found out that the return value from format_exception function is NOT a list, i.e. PyList_Check() fails. PySequence_Check() succeeds but then PySequence_List() gives me back -1. So wtf? I must say the API is crap on this part. Im trying to get error

traceback over C API and PyObject_CallObject

2007-10-19 Thread Sami Vaisanen
Hello group, I'm trying to get the Python exception information (message and traceback) stored into a string in my C++ code. However all i get back is the string None. All the checks pass and all pointers get a value from the python API calls. I've also tried with a different function such as

Re: Getting error message/trace over the C API

2007-10-18 Thread Sami Vaisanen
On Tue, 16 Oct 2007 18:55:22 +, Duncan Booth wrote: Sami Vaisanen [EMAIL PROTECTED] wrote: Hello group, I'm writing a C++ based application that embeds the python engine. Now I have a problem regarding exception/error information. Is there a way to get the exception message

Re: Extending Python with C API

2007-10-18 Thread Sami Vaisanen
On Thu, 13 Sep 2007 21:26:33 -0400, Carsten Haese wrote: On Thu, 2007-09-13 at 18:05 -0700, Thierry Masson wrote: Hello, I'm trying to use the C API to extend Python. I've looked at various books and web sites (including the docs at python.org) and I can't get any of the samples to work.

Getting error message/trace over the C API

2007-10-16 Thread Sami Vaisanen
Hello group, I'm writing a C++ based application that embeds the python engine. Now I have a problem regarding exception/error information. Is there a way to get the exception message and possibly the traceback into a string for example? I've been eyeballing the PyErr_ module and it seems fairly