From 450b732a2c0a95d9cf26837a653f62f2165680c6 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 20 Feb 2008 10:05:54 +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 | 10 ++++++++++ 1 file changed, 10 insertions(+) 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(); -- 2.39.2