[C++-sig] Re: Can anybody tell me the other difference between these 2 little programs?

yakumoklesk at yahoo.es yakumoklesk at yahoo.es
Thu Sep 11 20:56:49 CEST 2003


Hehehe, good joke with the "diff" command. Well, if this error is 
something that is in the TODO list, I'll take the way that does not crash 
for the moment.

Thank you David.

David Lucena.


On 11 Sep 2003 at 12:43, David Abrahams wrote:

> yakumoklesk at yahoo.es writes:
> 
> >
> > The first difference I have found is that the first version exits with an error
> >
> > Fatal Python error: PyThreadState_Get: no current thread
> >
> > while the second version works OK.
> 
> $ diff bu1.cpp bu2.cpp
> --- c:/tmp/bu1.cpp	2003-09-11 12:40:06.000000000 -0400
> +++ c:/tmp/bu2.cpp	2003-09-11 12:39:55.000000000 -0400
> @@ -1,4 +1,4 @@
> -int main( int argc, char** argv )
> +void test()
>  {
>  	Py_Initialize();
>  
> @@ -16,6 +16,10 @@
>  	handle<> resNoneResult( PyEval_CallObject( funcPrintTree.get(), argFuncArgs 
>  ) );
>  	Py_DECREF( argFuncArgs );
> +}
> +int main( int argc, char** argv )
> +{
> +	test();
>  
>  	Py_Finalize();
>  
> 
> ...but seriously, folks:
> http://www.boost-consulting.com/boost/libs/python/todo.html#pyfinalize-safety
> 
> HTH,
> 
> -- 
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com
> 
> 
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig






More information about the Cplusplus-sig mailing list