summaryrefslogtreecommitdiff
path: root/decoder.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2017-03-31 19:18:19 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2017-03-31 19:18:19 +0200
commite51475add18d4a6ee4e30c4c5891b6de64c7c148 (patch)
tree6e71b12668b34579320c726cd0bb6f546a5a301b /decoder.c
parente125d0f74b7a5d23354d45ab114da82ec2532423 (diff)
downloadlibsigrokdecode-e51475add18d4a6ee4e30c4c5891b6de64c7c148.tar.gz
libsigrokdecode-e51475add18d4a6ee4e30c4c5891b6de64c7c148.zip
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).
Diffstat (limited to 'decoder.c')
-rw-r--r--decoder.c7
1 files changed, 5 insertions, 2 deletions
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)