Skip to content

Commit

Permalink
chore: Python type linting
Browse files Browse the repository at this point in the history
  • Loading branch information
HunterBarclay committed Oct 21, 2024
1 parent e09be3c commit 7cb3837
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def readFromDesign(self) -> "ExporterOptions":
for field in fields(self):
attribute = designAttributes.itemByName(INTERNAL_ID, field.name)
if attribute:
attrJsonData = makeObjectFromJson(field.type, json.loads(attribute.value))
attrJsonData = makeObjectFromJson(type(field.type), json.loads(attribute.value))
setattr(self, field.name, attrJsonData)

return self
Expand Down
2 changes: 1 addition & 1 deletion exporter/SynthesisFusionAddin/src/Types.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def makeObjectFromJson(objType: type, data: Any) -> Any:
assert is_dataclass(obj) and isinstance(data, dict), "Found unsupported type to decode."
for field in fields(obj):
if field.name in data:
setattr(obj, field.name, makeObjectFromJson(field.type, data[field.name]))
setattr(obj, field.name, makeObjectFromJson(type(field.type), data[field.name]))
else:
setattr(obj, field.name, field.default_factory if field.default_factory is not MISSING else field.default)

Expand Down

0 comments on commit 7cb3837

Please sign in to comment.