[C++-sig] Python exception traceback infomation in C++

2009-04-04 Thread John Reid
I call my C++ extension from python and the C++ code in turn calls back 
into python code. When the python callbacks raise exceptions I can't 
easily find out the tracebacks, they stop short at the C++ interface. I 
might put decorators on all my python callbacks to log the tracebacks. 
Is there any better way to do this failing an extension of boost.python 
to propagate this information through the C++ layer?


Did anything ever happen with the discussion in this thread?
http://thread.gmane.org/gmane.comp.python.c++/12693/focus=12701

Regards,
John.

___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig


Re: [C++-sig] instantiate python classes in c++

2009-04-04 Thread Gregor Burger
On Fri, Apr 3, 2009 at 4:40 PM, Gennadiy Rozental  wrote:

> Gregor Burger  uibk.ac.at> writes:
>
> > is it possible to use boost.python to define classes
> > in a script (like in the one below), register the defined
> > classes and later on create instances of the class?
>
> Yes

thank god! ;-)

>
>
> > Is it possible to provide the same globals and locals to call_method
> > so that Flow and other classes are defined?
>
> No. You can't "update" global dictionary at the call point.
>
> This is the issue I am very much familiar with. You can find 2 posts from
> me
> with pretty much the same content.

Maybe you can point me to the posts. I found you questions but not the
answer including the solution.

>
>
> The only viable solution I found is to *compile* the script first before
> executing it. If I do this global dictionary is bound to the class methods
> and
> you code will work fine.
>
> Gennadiy
>
> ___
> Cplusplus-sig mailing list
> Cplusplus-sig@python.org
> http://mail.python.org/mailman/listinfo/cplusplus-sig
>
___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] instantiate python classes in c++

2009-04-04 Thread Gennadiy Rozental
Gregor Burger  uibk.ac.at> writes:

> Maybe you can point me to the posts. I found you questions 
> but not theanswer including the solution.  

The only solution I know is right below.
 
>> The only viable solution I found is to *compile* the script first before
>> executing it. If I do this global dictionary is bound to the class methods 
>> and
>> you code will work fine.

Gennadiy

___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig