Fix bpy_types.Context annotation not being qualified to bpy.types.Context

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph HENRY 2026-03-31 16:39:50 +02:00
parent 9e4bcdd283
commit a25340f7cf

View File

@ -949,6 +949,7 @@ def _annotation_to_type_str(ann: object) -> str:
s = ann if isinstance(ann, str) else str(ann)
# Clean up internal module references
s = s.replace("_bpy_types.", "bpy.types.")
s = s.replace("bpy_types.", "bpy.types.")
# typing.Union[X, Y] -> X | Y
s = re.sub(r"\bUnion\[([^\]]+)\]", lambda m: " | ".join(m.group(1).split(", ")), s)
# typing.Optional[X] -> X | None