From 5dbce044787b9b0df285c935a6974b1d41b459c8 Mon Sep 17 00:00:00 2001 From: Jeremie Leska Date: Tue, 13 Jan 2026 16:40:15 +0100 Subject: [PATCH] schema: remove error after lyd_value_validate_dflt call libyang returns the realtype field when the store callback return code is LY_SUCCESS and LY_EINCOMPLETE. Don't raise an error when lyd_value_validate_dflt returns LY_EINCOMPLETE. The function can then use the val_type_cdata field. Link: https://github.com/CESNET/libyang/blob/master/src/tree_data_common.c#L682 Signed-off-by: Jeremie Leska --- libyang/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libyang/schema.py b/libyang/schema.py index f104a87..616c5c7 100644 --- a/libyang/schema.py +++ b/libyang/schema.py @@ -1545,7 +1545,7 @@ def default(self) -> Union[None, bool, int, str, float]: val_type_cdata, ffi.NULL, ) - if ret != lib.LY_SUCCESS: + if ret not in (lib.LY_SUCCESS, lib.LY_EINCOMPLETE): raise self.context.error("Unable to get real type of default value") self.cdata_default_realtype = Type(self.context, val_type_cdata[0], None)