Browse Source

remove references to interpreter

python
Jørgen Lien Sellæg 7 years ago committed by Jørgen Sverre Lien Sellæg
parent
commit
05b5b57997
  1. 9
      src/plugins.cc

9
src/plugins.cc

@ -36,15 +36,8 @@ void Plugins::load() {
const auto is_pycache = module_name == "__pycache__"; const auto is_pycache = module_name == "__pycache__";
if((is_directory && !is_pycache) || has_py_extension) { if((is_directory && !is_pycache) || has_py_extension) {
try { try {
auto module = interpreter.add_module(module_name); auto module = py::module::import(module_name.c_str());
if(module) {
Terminal::get().print("Reloading plugin ´" + module_name + "´\n");
interpreter.reload_module(module);
}
else {
Terminal::get().print("Loading plugin ´" + module_name + "´\n"); Terminal::get().print("Loading plugin ´" + module_name + "´\n");
py::module::import(module_name.c_str());
}
} }
catch(py::error_already_set &error) { catch(py::error_already_set &error) {
Terminal::get().print("Error loading plugin `" + module_name + "`:\n" + error.what() + "\n"); Terminal::get().print("Error loading plugin `" + module_name + "`:\n" + error.what() + "\n");

Loading…
Cancel
Save