[C++-sig] embedding python: PyGrammar_FindDFA error

Thomas Hrabe thrabe at burnham.org
Fri May 23 01:59:00 CEST 2008


found it myself,

it was a wrong flag for the second argument in PyRun_String.
It has to be 
Py_eval_input

Thanks

-----Ursprüngliche Nachricht-----
Von: c++-sig-bounces+thrabe=burnham.org at python.org im Auftrag von Thomas Hrabe
Gesendet: Do 22.05.2008 16:12
An: c++-sig at python.org
Betreff: [C++-sig] embedding python: PyGrammar_FindDFA error
 
Hi all,

I am experiencing an error with mz embedded python C program.

I create an object in python, but can not retrieve it correctly.

My code:


PyObject *f_globals = PyModule_GetDict(mainModule);
PyRun_SimpleString("a = 1");
PyObject* o = PyRun_String("a",0, f_globals, f_globals);

The error:

Assertion failed: (d->d_type == type), function PyGrammar_FindDFA, file Parser/grammar1.c, line 18.


Python is initialised and everything.
Does anybody know what this means. I assume that I do not call PyRun_String correctly.

By the way, its osX Leopard, python 2.5

Does anybody have a clue?

Best,
Thomas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20080522/9b150ceb/attachment.htm>


More information about the Cplusplus-sig mailing list