Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions libyang/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,11 @@ def units(self) -> Optional[str]:
return c2str(self.cdata_leaf.units)

def type(self) -> Type:
return Type(self.context, self.cdata_leaf.type, self.cdata_leaf_parsed.type)
return Type(
self.context,
self.cdata_leaf.type,
self.cdata_leaf_parsed.type if self.cdata_leaf_parsed else None,
)

def is_key(self) -> bool:
if self.cdata_leaf.flags & lib.LYS_KEY:
Expand Down Expand Up @@ -1600,7 +1604,9 @@ def units(self) -> Optional[str]:

def type(self) -> Type:
return Type(
self.context, self.cdata_leaflist.type, self.cdata_leaflist_parsed.type
self.context,
self.cdata_leaflist.type,
self.cdata_leaflist_parsed.type if self.cdata_leaflist_parsed else None,
)

def defaults(self) -> Iterator[Union[None, bool, int, str, float]]:
Expand Down