From c98dd38f9fae2a4219294bf3a009b542f7c672f9 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 20 Feb 2008 10:06:24 +0000 Subject: [PATCH] + 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__"); + } --- src/PythonConsole/PythonConsole_PyInterp.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) 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); -- 2.39.2