diff options
Diffstat (limited to 'grc/base')
-rw-r--r-- | grc/base/Block.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/grc/base/Block.py b/grc/base/Block.py index 82d276567..349e71f76 100644 --- a/grc/base/Block.py +++ b/grc/base/Block.py @@ -47,7 +47,9 @@ class TemplateArg(UserDict): return self._param.get_evaluated() def _get_keys(lst): return [elem.get_key() for elem in lst] -def _get_elem(lst, key): return lst[_get_keys(lst).index(key)] +def _get_elem(lst, key): + try: return lst[_get_keys(lst).index(key)] + except ValueError: raise ValueError, 'Key "%s" not found in %s.'%(key, _get_keys(lst)) class Block(Element): |