From: eap Date: Wed, 20 Feb 2008 10:05:54 +0000 (+0000) Subject: + if(!builtinmodule) // PAL18041: deepcopy function don't work in Salome X-Git-Tag: V4_1_1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=450b732a2c0a95d9cf26837a653f62f2165680c6;p=modules%2Fgui.git + if(!builtinmodule) // PAL18041: deepcopy function don't work in Salome + { + //builtinmodule is static member of PyInterp class + //If it is not NULL (initialized to the builtin module of the main interpreter + //all the sub interpreters will have the same builtin + //_interp is a static member and is the main interpreter + //The first time we initialized it to the builtin of main interpreter + builtinmodule=PyDict_GetItemString(_interp->modules, "__builtin__"); + } --- diff --git a/src/PythonConsole/PythonConsole_PyInterp.cxx b/src/PythonConsole/PythonConsole_PyInterp.cxx index 0046f02e3..e54023779 100755 --- a/src/PythonConsole/PythonConsole_PyInterp.cxx +++ b/src/PythonConsole/PythonConsole_PyInterp.cxx @@ -108,6 +108,16 @@ bool PythonConsole_PyInterp::initState() * will have the same __builtin__ module */ + if(!builtinmodule) // PAL18041: deepcopy function don't work in Salome + { + //builtinmodule is static member of PyInterp class + //If it is not NULL (initialized to the builtin module of the main interpreter + //all the sub interpreters will have the same builtin + //_interp is a static member and is the main interpreter + //The first time we initialized it to the builtin of main interpreter + builtinmodule=PyDict_GetItemString(_interp->modules, "__builtin__"); + } + if(builtinmodule) { PyObject *m = PyImport_GetModuleDict();