File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -2583,7 +2583,8 @@ str_attr_accessor object_api<D>::doc() const {
25832583
25842584template <typename D>
25852585object object_api<D>::annotations() const {
2586- #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION <= 9
2586+ #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION <= 9 \
2587+ || PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 14
25872588 // https://docs.python.org/3/howto/annotations.html#accessing-the-annotations-dict-of-an-object-in-python-3-9-and-older
25882589 if (!hasattr (derived (), " __annotations__" )) {
25892590 setattr (derived (), " __annotations__" , dict ());
Original file line number Diff line number Diff line change @@ -1146,10 +1146,7 @@ def get_annotations_helper(o):
11461146 if sys .version_info >= (3 , 14 ):
11471147 import annotationlib
11481148
1149- try :
1150- return annotationlib .get_annotations (o ) or None
1151- except TypeError :
1152- return None
1149+ return annotationlib .get_annotations (o ) or None
11531150 if isinstance (o , type ):
11541151 return o .__dict__ .get ("__annotations__" , None )
11551152 return getattr (o , "__annotations__" , None )
You can’t perform that action at this time.
0 commit comments