Python silently uses the existing module anyway, but the library
was counting it as an extra module. This was exposed by a test
case in the test suite.
if (!module_name)
return SRD_ERR_ARG;
+ if (PyDict_GetItemString(PyImport_GetModuleDict(), module_name)) {
+ /* Module was already imported. */
+ return SRD_OK;
+ }
+
srd_dbg("Loading protocol decoder '%s'.", module_name);
py_basedec = py_method = py_attr = NULL;