private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Nov 14 01:57:15 EST 2007


En Tue, 13 Nov 2007 19:59:56 -0300, <sndive at gmail.com> escribió:

> working on a smaller example. i could not get pyNode_root invoked yet
> and
> PyRun_String("import node\nprint node.root()\n",
>                  Py_file_input,
>                  exec, g_maindict);

The globals argument should contain (at least) a key "__builtins__"  
pointing to the __builtin__ module; else, no builtin functions (like  
__import__) will be found. PyEval_Globals (you used it somewhere) returns  
a suitable globals argument.

-- 
Gabriel Genellina




More information about the Python-list mailing list