Allow to run script in global environment
This commit is contained in:
@@ -71,6 +71,7 @@ void MacroManager::OnChange(Base::Subject<const char*> &rCaller, const char * sR
|
||||
this->recordGui = this->params->GetBool("RecordGui", true);
|
||||
this->guiAsComment = this->params->GetBool("GuiAsComment", true);
|
||||
this->scriptToPyConsole = this->params->GetBool("ScriptToPyConsole", true);
|
||||
this->localEnv = this->params->GetBool("LocalEnvironment", true);
|
||||
}
|
||||
|
||||
void MacroManager::open(MacroType eType,const char *sName)
|
||||
@@ -228,7 +229,7 @@ void MacroManager::run(MacroType eType,const char *sName)
|
||||
PythonRedirector std_out("stdout",pyout);
|
||||
PythonRedirector std_err("stderr",pyerr);
|
||||
//The given path name is expected to be Utf-8
|
||||
Base::Interpreter().runFile(sName, true);
|
||||
Base::Interpreter().runFile(sName, this->localEnv);
|
||||
}
|
||||
catch (const Base::SystemExitException&) {
|
||||
Base::PyGILStateLocker lock;
|
||||
|
||||
Reference in New Issue
Block a user