Skip to content

Commit

Permalink
Patch abstract Set's with built-in set (#9)
Browse files Browse the repository at this point in the history
We replace `collections.abc.Set` with a built-in `set`. Micropython does
not support `collections.abc`.
  • Loading branch information
mristin authored Aug 25, 2024
1 parent 472c4e5 commit 8cd0450
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dev_scripts/patch_aas_core_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,12 @@ def _replace_collections_abc_with_native_types(text: str) -> str:
range=patching.cast_node_to_range(node), replacement="list"
)
)
elif node.attr == "Set":
patches.append(
patching.Patch(
range=patching.cast_node_to_range(node), replacement="set"
)
)
else:
raise NotImplementedError(f"Unhandled collections.abc: {ast.dump(node)}")

Expand Down

0 comments on commit 8cd0450

Please sign in to comment.