From 1d84dc8e8f916bb0854e80e60bad1006d8d7be25 Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Mon, 15 Mar 2021 10:02:45 +0100 Subject: [PATCH] API options: Fix case when no options are present In that case we want to pass by returning an empty dict, as docstring already describes. Before this, the code failed when checking for included version. Change-Id: Ia0d6b81a64ad0e7027ac7daf15c72ace1f6982ce Signed-off-by: Vratko Polak --- resources/libraries/python/VppApiCrc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/libraries/python/VppApiCrc.py b/resources/libraries/python/VppApiCrc.py index 94e2690d8b..1fcb91d4b9 100644 --- a/resources/libraries/python/VppApiCrc.py +++ b/resources/libraries/python/VppApiCrc.py @@ -197,8 +197,8 @@ class VppApiCrcChecker: for item in reversed(msg_obj): if not isinstance(item, dict): continue - options = item.get(u"options", None) - if options is not None: + options = item.get(u"options", dict()) + if not options: break if version is None or version.startswith(u"0."): options[u"version"] = version -- 2.16.6