Commit cfbcc2f5 authored by oroulet's avatar oroulet Committed by oroulet

fix default Dataclass value bug exposed by python 3.11

parent a0de6220
......@@ -157,7 +157,7 @@ def get_default_value(uatype, enums=None):
# We have an enum, try to initilize it correctly
val = list(getattr(ua, uatype).__members__)[0]
return f"ua.{uatype}.{val}"
return f"ua.{uatype}()"
return f"field(default_factory=ua.{uatype})"
def make_structure_code(data_type, struct_name, sdef, log_error=True):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment