Skip to content

Commit 6a149e5

Browse files
committed
m1n1.constructutils: Improve json serialization of Value types
Signed-off-by: Asahi Lina <[email protected]>
1 parent 311385e commit 6a149e5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

proxyclient/m1n1/constructutils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,11 @@ def items(self):
599599
for k in list(self):
600600
if k.startswith("_"):
601601
continue
602-
yield k, self[k]
602+
v = self[k]
603+
if getattr(v, "HAS_VALUE", None):
604+
yield k, v.value
605+
else:
606+
yield k, v
603607

604608
def addrof(self, name):
605609
return self._addr + self._off[name][0]
@@ -724,6 +728,7 @@ class ConstructValueClass(ConstructClassBase):
724728
725729
the value is stored as .value
726730
"""
731+
HAS_VALUE = True
727732

728733
def __eq__(self, other):
729734
return self.value == other.value

0 commit comments

Comments
 (0)