Fix double loading plugins and sys.path entires multiplying
(cherry picked from commit b53b68c686
)
This commit is contained in:
parent
4eb9440a42
commit
8b1f1c0296
|
@ -68,7 +68,7 @@ bool SCRIPTING_TOOL::Init()
|
||||||
PyDict_SetItemString( sys_mod, "_pcbnew", mod );
|
PyDict_SetItemString( sys_mod, "_pcbnew", mod );
|
||||||
Py_DECREF( mod );
|
Py_DECREF( mod );
|
||||||
|
|
||||||
callLoadPlugins();
|
// plugins will be loaded later via ReloadPlugins()
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -253,7 +253,8 @@ def LoadPlugins(bundlepath=None, userpath=None, thirdpartypath=None):
|
||||||
if not os.path.isdir( plugins_dir ):
|
if not os.path.isdir( plugins_dir ):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
sys.path.append( plugins_dir )
|
if plugins_dir not in sys.path:
|
||||||
|
sys.path.append( plugins_dir )
|
||||||
|
|
||||||
for module in os.listdir(plugins_dir):
|
for module in os.listdir(plugins_dir):
|
||||||
fullPath = os.path.join( plugins_dir, module )
|
fullPath = os.path.join( plugins_dir, module )
|
||||||
|
|
Loading…
Reference in New Issue