diff options
author | Igor Freire <igor@blockstream.com> | 2021-04-10 15:44:18 -0300 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-04-19 06:40:56 -0400 |
commit | 0b3dc1b157b709fcd64a80f13ec604bda3f86e66 (patch) | |
tree | 2bfae477405c67e9ed17e92f7472ae3f78650396 /grc/core/blocks/_build.py | |
parent | ab3137c5fecd90a3b1c5b5c49e10c2fd81516615 (diff) |
grc: Fix option_attributes check on inherited type
Run the option_attributes validation routine on the extended dictionary,
i.e., after inheriting the properties from the base_key parameter. By
doing so, if the dtype property is inherited, the
_validate_option_attributes still sees it and does not throw a key
error.
Signed-off-by: Igor Freire <igor@blockstream.com>
Diffstat (limited to 'grc/core/blocks/_build.py')
-rw-r--r-- | grc/core/blocks/_build.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/grc/core/blocks/_build.py b/grc/core/blocks/_build.py index d037d82a4b..c360416b90 100644 --- a/grc/core/blocks/_build.py +++ b/grc/core/blocks/_build.py @@ -116,13 +116,13 @@ def build_params(params_raw, have_inputs, have_outputs, flags, block_id): if param_id in params: raise Exception('Param id "{}" is not unique'.format(param_id)) - if 'option_attributes' in param_data: - _validate_option_attributes(param_data, block_id) - base_key = param_data.get('base_key', None) param_data_ext = base_params_n.get(base_key, {}).copy() param_data_ext.update(param_data) + if 'option_attributes' in param_data: + _validate_option_attributes(param_data_ext, block_id) + add_param(**param_data_ext) base_params_n[param_id] = param_data_ext |