Skip to content

Commit 7a3aaaa

Browse files
matttbekuba-moo
authored andcommitted
tools: ynl: fix undefined variable name
This variable used in the error path was not defined according to Ruff. msg_format.attr_set is used instead, presumably the one that was supposed to be used originally. This is linked to Ruff error F821 [1]: An undefined name is likely to raise NameError at runtime. Fixes: 1769e2b ("tools/net/ynl: Add 'sub-message' attribute decoding to ynl") Link: https://docs.astral.sh/ruff/rules/undefined-name/ [1] Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Reviewed-by: Donald Hunter <[email protected]> Reviewed-by: Asbjørn Sloth Tønnesen <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 724b22d commit 7a3aaaa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/net/ynl/pyynl/lib/ynl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ def _decode_sub_msg(self, attr, attr_spec, search_attrs):
746746
subdict = self._decode(NlAttrs(attr.raw, offset), msg_format.attr_set)
747747
decoded.update(subdict)
748748
else:
749-
raise Exception(f"Unknown attribute-set '{attr_space}' when decoding '{attr_spec.name}'")
749+
raise Exception(f"Unknown attribute-set '{msg_format.attr_set}' when decoding '{attr_spec.name}'")
750750
return decoded
751751

752752
def _decode(self, attrs, space, outer_attrs = None):

0 commit comments

Comments
 (0)