From 2c0e634edfdbaa576c3203e3ab068f2f78815c89 Mon Sep 17 00:00:00 2001 From: devttys0 <cheffner@refirmlabs.com> Date: Wed, 13 Dec 2017 10:34:50 -0500 Subject: [PATCH] Changed how plugin exceptions are handled/reported. --- src/binwalk/core/plugin.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/binwalk/core/plugin.py b/src/binwalk/core/plugin.py index 023075e..36a802f 100644 --- a/src/binwalk/core/plugin.py +++ b/src/binwalk/core/plugin.py @@ -183,13 +183,14 @@ class Plugins(object): plugins[key]['modules'].append(module) except KeyboardInterrupt as e: raise e + # Python files in the plugins directory that are not + # actually binwalk plugins will generate a TypeError + # about converting an object to a string implicitly. + # Don't need to warn about these. + except TypeError: + pass except Exception as e: - # Python files in the plugins directory that are not - # actually binwalk plugins will generate a TypeError - # about converting an object to a string implicitly. - # Don't need to warn about these. - if not str(e).endswith('object to str implicitly'): - binwalk.core.common.warning("Error loading plugin '%s': %s" % (file_name, str(e))) + binwalk.core.common.warning("Error loading plugin '%s': %s" % (file_name, str(e))) plugins[key]['enabled'][module] = False try: -- libgit2 0.26.0