From e51475add18d4a6ee4e30c4c5891b6de64c7c148 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Fri, 31 Mar 2017 19:18:19 +0200 Subject: Don't show a harmless/confusing warning on stdout. Some Python versions will lead to the following message on stdout currently: srd: Attribute Error: Failed to load decoder common: no 'Decoder' \ attribute in imported module: 'module' object has no attribute 'Decoder' This is a harmless (though confusing for users) warning, since "common" is not an actual PD and it shouldn't be loaded as PD (it just has to be present). --- decoder.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'decoder.c') diff --git a/decoder.c b/decoder.c index 83b758f..9990e29 100644 --- a/decoder.c +++ b/decoder.c @@ -767,8 +767,11 @@ SRD_API int srd_decoder_load(const char *module_name) return SRD_OK; except_out: - srd_exception_catch("Failed to load decoder %s: %s", - module_name, fail_txt); + /* Don't show a message for the "common" directory, it's not a PD. */ + if (strcmp(module_name, "common")) { + srd_exception_catch("Failed to load decoder %s: %s", + module_name, fail_txt); + } fail_txt = NULL; err_out: if (fail_txt) -- cgit v1.2.3-70-g09d2