From dc50d014cf45dc4633a642b5d745e94bcd82a3d5 Mon Sep 17 00:00:00 2001
From: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
Date: Wed, 24 Jul 2019 12:12:07 +0200
Subject: Fix KeyError in variable blocks

variable blocks without a param value need to be updated otherwise the variable_block.namespace is wrong
---
 grc/core/FlowGraph.py | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'grc/core/FlowGraph.py')

diff --git a/grc/core/FlowGraph.py b/grc/core/FlowGraph.py
index 7ee8e45f75..c2a5094541 100644
--- a/grc/core/FlowGraph.py
+++ b/grc/core/FlowGraph.py
@@ -223,8 +223,11 @@ class FlowGraph(Element):
         # Load variables
         for variable_block in self.get_variables():
             try:
+                variable_block.rewrite()
                 value = eval(variable_block.value, namespace, variable_block.namespace)
                 namespace[variable_block.name] = value
+            except TypeError: #Type Errors may happen, but that desn't matter as they are displayed in the gui
+                pass
             except Exception:
                 log.exception('Failed to evaluate variable block {0}'.format(variable_block.name), exc_info=True)
                 pass
-- 
cgit v1.2.3