Skip to content

Commit

Permalink
Handled ignore typing section
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonPacewic committed Aug 14, 2024
1 parent 98f0347 commit a208903
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exporter/SynthesisFusionAddin/src/Types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import platform
from dataclasses import MISSING, dataclass, field, fields, is_dataclass
from enum import Enum, EnumType
from typing import Any, TypeAlias, get_origin
from typing import Any, TypeAlias, get_args, get_origin

# Not 100% sure what this is for - Brandon
JointParentType = Enum("JointParentType", ["ROOT", "END"])
Expand Down Expand Up @@ -103,7 +103,7 @@ def makeObjectFromJson(objType: type, data: Any) -> Any:
elif isinstance(objType, PRIMITIVES) or isinstance(data, PRIMITIVES):
return data
elif get_origin(objType) is list:
return [makeObjectFromJson(objType.__args__[0], item) for item in data] # type: ignore[attr-defined]
return [makeObjectFromJson(get_args(objType)[0], item) for item in data]

obj = objType()
assert is_dataclass(obj) and isinstance(data, dict), "Found unsupported type to decode."
Expand Down

0 comments on commit a208903

Please sign in to comment.