summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Braun <martin@gnuradio.org>2021-01-29 13:54:48 +0100
committerMartin Braun <martin@gnuradio.org>2021-01-29 05:02:52 -0800
commitb3cf9da3957962733d3b4ec7979dde97f32e090b (patch)
tree63995998af13ca152d11fc494973c19aa0c6fc3e
parentb16924381c90e07d5d8cf5bc236c7dc48a0fd677 (diff)
utils: modtool: Improve exception handling for import error
If an import error happens in get_command(), the error is now logged. Inspired-by: Ryan Govostes Signed-off-by: Martin Braun <martin@gnuradio.org>
-rw-r--r--gr-utils/modtool/cli/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gr-utils/modtool/cli/base.py b/gr-utils/modtool/cli/base.py
index 60ab419d3f..7b8c223751 100644
--- a/gr-utils/modtool/cli/base.py
+++ b/gr-utils/modtool/cli/base.py
@@ -59,8 +59,8 @@ class CommandCLI(click.Group):
"""
try:
mod = import_module('gnuradio.modtool.cli.' + cmd_name)
- except ImportError:
- logging.error(ImportError)
+ except ImportError as ex:
+ logging.error(str(ex))
return self.commands.get(cmd_name)
return mod.cli