PyConsole_Editor* theListener,
bool sync = false )
: PyInterp_LockRequest( theInterp, theListener, sync ),
- myCommand( theCommand ), myState( PyInterp_Event::OK )
+ myCommand( theCommand ), myState( PyInterp_Event::ES_OK )
{}
protected:
{
int ret = getInterp()->run( myCommand.toLatin1() );
if ( ret < 0 )
- myState = PyInterp_Event::ERROR;
+ myState = PyInterp_Event::ES_ERROR;
else if ( ret > 0 )
- myState = PyInterp_Event::INCOMPLETE;
+ myState = PyInterp_Event::ES_INCOMPLETE;
}
}
addText( pe->text() );
return;
}
- case PyInterp_Event::OK:
- case PyInterp_Event::ERROR:
+ case PyInterp_Event::ES_OK:
+ case PyInterp_Event::ES_ERROR:
{
// clear command buffer
myCommandBuffer.truncate( 0 );
myEventLoop->exit();
break;
}
- case PyInterp_Event::INCOMPLETE:
+ case PyInterp_Event::ES_INCOMPLETE:
{
// extend command buffer (multi-line command)
myCommandBuffer.append( "\n" );
// unset history browsing mode
myCmdInHistory = -1;
- if ( (int)event->type() == (int)PyInterp_Event::OK && myQueue.count() > 0 )
+ if ( (int)event->type() == (int)PyInterp_Event::ES_OK && myQueue.count() > 0 )
{
// process the next sheduled command from the queue (if there is any)
QString nextcmd = myQueue[0];
_tstate = Py_NewInterpreter(); // create an interpreter and save current state
PySys_SetArgv(PyInterp_Interp::_argc,PyInterp_Interp::_argv); // initialize sys.argv
+ 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 has been initialized all the sub interpreters
// will have the same __builtin__ module
if(builtinmodule){