Skip to content

Commit fb508a3

Browse files
Use an explicit version check to import typing or typing_extensions
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
1 parent 021acee commit fb508a3

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tests/test_main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import pickle
22

3-
try:
3+
import sys
4+
5+
if sys.version_info >= (3, 9):
46
from typing import Annotated, get_type_hints
5-
except ImportError:
6-
# Python < 3.9
7+
else:
78
from typing_extensions import Annotated, get_type_hints
89

910
from annotated_doc import Doc

0 commit comments

Comments
 (0)