From 68a5d5dc01bf0ecae518a242f205def06cafae07 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 21 Apr 2021 17:31:50 -0700 Subject: [PATCH] Fix issue reloading plugins --- pcbnew/python/scripting/pcb_scripting_tool.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pcbnew/python/scripting/pcb_scripting_tool.cpp b/pcbnew/python/scripting/pcb_scripting_tool.cpp index fe3939911f..9809cc9bbf 100644 --- a/pcbnew/python/scripting/pcb_scripting_tool.cpp +++ b/pcbnew/python/scripting/pcb_scripting_tool.cpp @@ -102,10 +102,12 @@ int SCRIPTING_TOOL::reloadPlugins( const TOOL_EVENT& aEvent ) { PyLOCK lock; + std::string sys_path = SCRIPTING::PyScriptingPath( false ).ToStdString(); + std::string user_path = SCRIPTING::PyScriptingPath( true ).ToStdString(); using namespace pybind11::literals; - auto locals = pybind11::dict( "sys_path"_a = SCRIPTING::PyScriptingPath( false ), - "user_path"_a = SCRIPTING::PyScriptingPath( true ) ); + auto locals = pybind11::dict( "sys_path"_a = sys_path, + "user_path"_a = user_path ); pybind11::exec( R"( import sys