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:
parent
9e4bcdd283
commit
a25340f7cf
@ -949,6 +949,7 @@ def _annotation_to_type_str(ann: object) -> str:
|
|||||||
s = ann if isinstance(ann, str) else str(ann)
|
s = ann if isinstance(ann, str) else str(ann)
|
||||||
# Clean up internal module references
|
# Clean up internal module references
|
||||||
s = s.replace("_bpy_types.", "bpy.types.")
|
s = s.replace("_bpy_types.", "bpy.types.")
|
||||||
|
s = s.replace("bpy_types.", "bpy.types.")
|
||||||
# typing.Union[X, Y] -> X | Y
|
# typing.Union[X, Y] -> X | Y
|
||||||
s = re.sub(r"\bUnion\[([^\]]+)\]", lambda m: " | ".join(m.group(1).split(", ")), s)
|
s = re.sub(r"\bUnion\[([^\]]+)\]", lambda m: " | ".join(m.group(1).split(", ")), s)
|
||||||
# typing.Optional[X] -> X | None
|
# typing.Optional[X] -> X | None
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user