Skip to content

Commit 1e7227b

Browse files
authored
Just use a version check
1 parent 9ba5bfd commit 1e7227b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

IPython/lib/pretty.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,10 @@ def _repr_pretty_(self, p, cycle):
110110
from typing import Dict
111111

112112
# Allow pretty-printing of functions with PEP-649 annotations
113-
try:
114-
# Actually an annotationlib symbol imported by inspect
115-
# but if inspect has it that should mean it can use it
116-
from inspect import Format
117-
except ImportError:
118-
pass
119-
else:
113+
if sys.version_info >= (3, 14):
114+
from annotationlib import Format
120115
from functools import partial
116+
121117
signature = partial(signature, annotation_format=Format.FORWARDREF)
122118

123119

0 commit comments

Comments
 (0)