| Store | Cart

RuntimeError: cannot unmarshal code objects in restricted execution mode

From: Denis S. Otkidach <o...@strana.ru>
Thu, 11 Mar 2004 17:14:45 +0300 (MSK)
More accurate: the problem is when module has compiled version
(.pyc), so I can run the script first time without error.

DSO> When I execute python code from C++ application with
DSO> PyEval_EvalCode and this code contains imports of other
DSO> modules
DSO> then I got the error "RuntimeError: cannot unmarshal code
DSO> objects
DSO> in restricted execution mode".  How can I switch into
DSO> noraml (unrestricted) mode?
DSO>
DSO> Python 2.2.2, Linux. Actual code looks like the following:
DSO>
DSO> tstate = Py_NewInterpreter();
DSO> main_module = PyImport_AddModule("__main__");
DSO> main_dict = PyModule_GetDict(main_module);
DSO> obj_res = PyEval_EvalCode(calc_code, main_dict, main_dict);

-- 
Denis S. Otkidach
http://www.python.ru/      [ru]

Recent Messages in this Thread
Denis S. Otkidach Mar 11, 2004 01:33 pm
Denis S. Otkidach Mar 11, 2004 02:14 pm
Jeff Epler Mar 11, 2004 02:42 pm
Messages in this thread