File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ QList<QList<QObject*>> ProxyPython::load(const PluginExtension& extension)
121121 }
122122
123123 if (extension.autodetect ()) {
124- log::error (" {}: automatic plugin detection is not supported for Python plugins" ,
124+ log::debug (" {}: automatic plugin detection is not supported for Python plugins" ,
125125 extension.metadata ().name ());
126126 return {};
127127 }
Original file line number Diff line number Diff line change @@ -174,6 +174,13 @@ namespace mo2::python {
174174 // load the module
175175 auto spec =
176176 importlib_util.attr (" spec_from_file_location" )(name, pythonModule);
177+
178+ if (Py_IsNone (spec.ptr ())) {
179+ MOBase::log::error (" failed to load Python plugin '{}' from '{}'" ,
180+ name, pythonModule);
181+ return {};
182+ }
183+
177184 pymodule = importlib_util.attr (" module_from_spec" )(spec);
178185 sys.attr (" modules" )[py::str (name)] = pymodule;
179186 spec.attr (" loader" ).attr (" exec_module" )(pymodule);
You can’t perform that action at this time.
0 commit comments