From: eap Date: Wed, 20 Feb 2008 10:06:24 +0000 (+0000) Subject: + if(!builtinmodule) // PAL18041: deepcopy function don't work in Salome X-Git-Tag: V3_2_10~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c98dd38f9fae2a4219294bf3a009b542f7c672f9;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 09ceadb27..228260165 100755 --- a/src/PythonConsole/PythonConsole_PyInterp.cxx +++ b/src/PythonConsole/PythonConsole_PyInterp.cxx @@ -88,6 +88,17 @@ bool PythonConsole_PyInterp::initState() * If builtinmodule has been initialized all the sub interpreters * 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(); PyDict_SetItemString(m, "__builtin__", builtinmodule);