RuntimeError: cannot unmarshal code objects in restricted execution mode

Denis S. Otkidach ods at strana.ru
Thu Mar 11 14:33:26 CET 2004


When I execute python code from C++ application with
PyEval_EvalCode and this code contains imports of other modules
then I got the error "RuntimeError: cannot unmarshal code objects
in restricted execution mode".  How can I switch into
noraml (unrestricted) mode?

Python 2.2.2, Linux. Actual code looks like the following:

tstate = Py_NewInterpreter();
main_module = PyImport_AddModule("__main__");
main_dict = PyModule_GetDict(main_module);
obj_res = PyEval_EvalCode(calc_code, main_dict, main_dict);

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





More information about the Python-list mailing list