diff options
author | Brennan Ashton <bashton@brennanashton.com> | 2018-11-18 07:35:05 -0800 |
---|---|---|
committer | Andrej Rode <mail@andrejro.de> | 2018-11-28 13:34:07 +0100 |
commit | 31885c7da227418f0f9dc5c4f55daba5fd04a7c0 (patch) | |
tree | bea6060a2a056dd82f89f3a8a52c309198d6853c /grc/core/FlowGraph.py | |
parent | d4225d6add2bda7e865e00aee31a57770336fa4b (diff) |
grc: Silence import warnings caused by hier blocks on namespace renewal
We do not have a good way right now to determine if an import is for a
hier block, these imports will fail as they are not in the search path
this is ok behavior, unfortunately we could be hiding other import bugs.
Fixes #2183
Diffstat (limited to 'grc/core/FlowGraph.py')
-rw-r--r-- | grc/core/FlowGraph.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/grc/core/FlowGraph.py b/grc/core/FlowGraph.py index a47513d314..2c3d6f26c7 100644 --- a/grc/core/FlowGraph.py +++ b/grc/core/FlowGraph.py @@ -191,8 +191,13 @@ class FlowGraph(Element): for expr in self.imports(): try: exec(expr, namespace) + except ImportError: + # We do not have a good way right now to determine if an import is for a + # hier block, these imports will fail as they are not in the search path + # this is ok behavior, unfortunately we could be hiding other import bugs + pass except Exception: - log.exception('Failed to evaluate expression in namespace', exc_info=True) + log.exception('Failed to evaluate import expression "{0}"'.format(expr), exc_info=True) pass for id, expr in self.get_python_modules(): |