[C++-sig] Re: Documentation error or too much newbie?

yakumoklesk at yahoo.es yakumoklesk at yahoo.es
Sat Sep 13 09:12:20 CEST 2003


Opps, sorry. In the documentation there is written

main_namespace dict(...)

I think it is

dict main_namespace(...), because dict is an boost.python object 
representing a python dict, isn't it?

But the fact is that

dict main_namespace( handle<>( borrowed( PyModule_GetDict( 
main_module.get() ) ) );

gives me an acces violation whet it is executed. Of course, before this 
line is executed first I initialize the pyton interpreter with Py_Initialize() 
and then I add the main module (if it isn't added yet) using the line (as 
shown in documentation)

handle<> main_module(borrowed( 
PyImport_AddModule("__main__") )); 

So, what have I forgot to do? How can I avoid the ACCES VIOLATION 
given by the execution of the "dict main_namespace(..)" statement?

Thanks.

David Lucena.

> > First of all I thought that the second line had an error: shouln't it be
> >
> > dict main_namespace(...) instead of dict main_namespace(...)?
> 
> You typed the same thing twice here.  What did you really mean?
> 
> -- 
> 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