This repository was archived by the owner on Jul 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 12
12
# limitations under the License.
13
13
from __future__ import annotations
14
14
from typing import Any , Optional
15
- from typing_extensions import TypedDict
15
+
16
+ try :
17
+ # python 3.7
18
+ from typing_extensions import TypedDict
19
+ except ImportError :
20
+ # python 3.8 +
21
+ from typing import TypedDict # type: ignore
16
22
17
23
18
24
class BaseEntity :
Original file line number Diff line number Diff line change 18
18
19
19
from requests import exceptions as request_exception
20
20
from typing import Optional
21
- from typing_extensions import Protocol
22
21
23
22
from .helpers import enums
24
23
from . import event_builder
25
24
26
25
REQUEST_TIMEOUT = 10
27
26
28
27
28
+ try :
29
+ # python 3.7
30
+ from typing_extensions import Protocol
31
+ except ImportError :
32
+ # python 3.8 +
33
+ from typing import Protocol # type: ignore
34
+
35
+
29
36
class CustomEventDispatcher (Protocol ):
30
37
"""Interface to enforce required method"""
31
38
def dispatch_event (self , event : Optional [event_builder .Event ]) -> None :
Original file line number Diff line number Diff line change 12
12
# limitations under the License.
13
13
14
14
from __future__ import annotations
15
- from typing_extensions import Literal
16
15
import json
17
16
import numbers
18
17
from typing import Any , Callable , Optional
22
21
from .enums import Errors
23
22
from .enums import VersionType
24
23
24
+ try :
25
+ # python 3.7
26
+ from typing_extensions import Literal
27
+ except ImportError :
28
+ # python 3.8 +
29
+ from typing import Literal # type: ignore
30
+
25
31
26
32
class ConditionOperatorTypes :
27
33
AND = 'and'
You can’t perform that action at this time.
0 commit comments