File tree 4 files changed +20
-36
lines changed
4 files changed +20
-36
lines changed Original file line number Diff line number Diff line change 1
- from typing import TYPE_CHECKING
1
+ import sys
2
2
3
- if TYPE_CHECKING :
3
+ if sys .version_info >= (3 , 8 ):
4
+ from typing import Protocol
5
+ from typing import runtime_checkable
6
+ else :
4
7
from typing_extensions import Protocol
5
8
from typing_extensions import runtime_checkable
6
- else :
7
- try :
8
- from typing import Protocol
9
- from typing import runtime_checkable
10
- except ImportError :
11
- from typing_extensions import Protocol
12
- from typing_extensions import runtime_checkable
13
9
14
10
from requests .cookies import RequestsCookieJar
15
11
Original file line number Diff line number Diff line change 1
- from typing import TYPE_CHECKING
1
+ import sys
2
2
from typing import Any
3
3
from typing import List
4
4
5
- if TYPE_CHECKING :
5
+ if sys .version_info >= (3 , 8 ):
6
+ from typing import Protocol
7
+ from typing import runtime_checkable
8
+ else :
6
9
from typing_extensions import Protocol
7
10
from typing_extensions import runtime_checkable
8
- else :
9
- try :
10
- from typing import Protocol
11
- from typing import runtime_checkable
12
- except ImportError :
13
- from typing_extensions import Protocol
14
- from typing_extensions import runtime_checkable
15
11
16
12
17
13
@runtime_checkable
Original file line number Diff line number Diff line change 1
1
"""OpenAPI core validation request protocols module"""
2
- from typing import TYPE_CHECKING
2
+ import sys
3
3
from typing import Optional
4
4
5
- if TYPE_CHECKING :
5
+ if sys .version_info >= (3 , 8 ):
6
+ from typing import Protocol
7
+ from typing import runtime_checkable
8
+ else :
6
9
from typing_extensions import Protocol
7
10
from typing_extensions import runtime_checkable
8
- else :
9
- try :
10
- from typing import Protocol
11
- from typing import runtime_checkable
12
- except ImportError :
13
- from typing_extensions import Protocol
14
- from typing_extensions import runtime_checkable
15
11
16
12
from openapi_core .spec import Spec
17
13
from openapi_core .validation .request .datatypes import RequestParameters
Original file line number Diff line number Diff line change 1
1
"""OpenAPI core validation response protocols module"""
2
- from typing import TYPE_CHECKING
2
+ import sys
3
3
from typing import Any
4
4
from typing import Mapping
5
5
from typing import Optional
6
6
7
- if TYPE_CHECKING :
7
+ if sys .version_info >= (3 , 8 ):
8
+ from typing import Protocol
9
+ from typing import runtime_checkable
10
+ else :
8
11
from typing_extensions import Protocol
9
12
from typing_extensions import runtime_checkable
10
- else :
11
- try :
12
- from typing import Protocol
13
- from typing import runtime_checkable
14
- except ImportError :
15
- from typing_extensions import Protocol
16
- from typing_extensions import runtime_checkable
17
13
18
14
from openapi_core .spec import Spec
19
15
from openapi_core .validation .request .protocols import Request
You can’t perform that action at this time.
0 commit comments