From ca1848db370c0a927ca9c67a55d329d245e77970 Mon Sep 17 00:00:00 2001 From: Stefan Gula Date: Wed, 28 Feb 2024 13:09:20 +0100 Subject: [PATCH] context: fix of get_module_data This patch fixes broken test related to get_module_data function Signed-off-by: Stefan Gula --- libyang/context.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libyang/context.py b/libyang/context.py index 94bba59..b457e7b 100644 --- a/libyang/context.py +++ b/libyang/context.py @@ -133,12 +133,11 @@ def get_module_data( Tuple of format string and YANG (sub)module schema """ if self._module_data_clb is None: - return "", None - fmt_str, module_data = self._module_data_clb( - mod_name, mod_rev, submod_name, submod_rev - ) - if module_data is None: - return fmt_str, None + return None + ret = self._module_data_clb(mod_name, mod_rev, submod_name, submod_rev) + if ret is None: + return None + fmt_str, module_data = ret module_data_c = str2c(module_data) self._cdata_modules.append(module_data_c) return fmt_str, module_data_c