Skip to content

Commit c3890f4

Browse files
committed
Fix in HybridClass.to_dict
1 parent 6ec0acb commit c3890f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

xobjects/hybrid_class.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,9 @@ def to_dict(self, copy_to_cpu=True):
296296

297297
defaults = {}
298298
for field in obj._XoStruct._fields:
299+
name = obj._rename.get(field.name, field.name)
299300
try:
300-
defaults[field.name] = field.get_default()
301+
defaults[name] = field.get_default()
301302
except (TypeError, ValueError):
302303
# The above can fail with different error types
303304
# if a field type is dynamic.

0 commit comments

Comments
 (0)