Skip to content

Commit

Permalink
get origin cls in new python cls
Browse files Browse the repository at this point in the history
  • Loading branch information
enitrat committed Dec 30, 2024
1 parent f3c3800 commit ce10f40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cairo/tests/utils/serde.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,12 @@ def serialize_type(self, path: Tuple[str, ...], ptr) -> Any:
if "__main__" in full_path:
full_path = self.main_part + full_path[full_path.index("__main__") + 1 :]
python_cls = to_python_type(full_path)
origin_cls = get_origin(python_cls) or python_cls
origin_cls = get_origin(python_cls)
annotations = []

if get_origin(python_cls) is Annotated:
python_cls, *annotations = get_args(python_cls)
origin_cls = get_origin(python_cls)

if origin_cls is Union:
value_ptr = self.serialize_pointers(path, ptr)["value"]
Expand Down

0 comments on commit ce10f40

Please sign in to comment.