We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82c96b2 commit 85a1302Copy full SHA for 85a1302
curl_cffi/requests/session.py
@@ -1,5 +1,6 @@
1
from __future__ import annotations
2
3
+import sys
4
import asyncio
5
import queue
6
import threading
@@ -19,8 +20,8 @@
19
20
TypedDict,
21
Union,
22
cast,
23
+ Generic,
24
)
-from typing_extensions import TypeVar, Generic
25
from urllib.parse import urlparse
26
27
from ..aio import AsyncCurl
@@ -41,7 +42,15 @@
41
42
with suppress(ImportError):
43
import eventlet.tpool
44
-R = TypeVar('R', bound=Response, default=Response)
45
+try:
46
+ from typing_extensions import TypeVar
47
+except ImportError:
48
+ from typing import TypeVar
49
+
50
+if sys.version >= (3, 12):
51
+ R = TypeVar('R', bound=Response, default=Response)
52
+else:
53
+ R = TypeVar('R', bound=Response)
54
55
if TYPE_CHECKING:
56
from typing_extensions import Unpack
0 commit comments