Skip to content

Commit c5699a8

Browse files
committed
fix: handle empty annotations 3.14
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 76408fd commit c5699a8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_pytypes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,10 @@ def get_annotations_helper(o):
11461146
if sys.version_info >= (3, 14):
11471147
import annotationlib
11481148

1149-
return annotationlib.get_annotations(o)
1149+
try:
1150+
return annotationlib.get_annotations(o) or None
1151+
except TypeError:
1152+
return None
11501153
if isinstance(o, type):
11511154
return o.__dict__.get("__annotations__", None)
11521155
return getattr(o, "__annotations__", None)

0 commit comments

Comments
 (0)