There was an error while loading. Please reload this page.
1 parent 199cd54 commit 034d797Copy full SHA for 034d797
1 file changed
src/attr/_compat.py
@@ -17,10 +17,16 @@
17
PY_3_14_PLUS = sys.version_info[:2] >= (3, 14)
18
19
20
-if PY_3_14_PLUS: # pragma: no cover
+if PY_3_14_PLUS:
21
import annotationlib
22
23
- _get_annotations = annotationlib.get_annotations
+ # We request stringified annotations to not break in the presence of
24
+ # forward references.
25
+
26
+ def _get_annotations(cls):
27
+ return annotationlib.get_annotations(
28
+ cls, format=annotationlib.Format.STRING
29
+ )
30
31
else:
32
0 commit comments