File tree 1 file changed +3
-9
lines changed
1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
3
import enum
4
- import sys
5
4
import typing as t
6
5
7
6
import click
11
10
from ..regex_variants import RegexImplementation , RegexVariantName
12
11
from ..transforms import Transform
13
12
14
- if sys .version_info >= (3 , 8 ):
15
- from typing import Literal
16
- else :
17
- from typing_extensions import Literal
18
-
19
13
20
14
class SchemaLoadingMode (enum .Enum ):
21
15
filepath = "filepath"
@@ -51,11 +45,11 @@ def __init__(self) -> None:
51
45
52
46
def set_regex_variant (
53
47
self ,
54
- variant_opt : Literal ["python" , "nonunicode" , "default" ] | None ,
48
+ variant_opt : t . Literal ["python" , "nonunicode" , "default" ] | None ,
55
49
* ,
56
- legacy_opt : Literal ["python" , "nonunicode" , "default" ] | None = None ,
50
+ legacy_opt : t . Literal ["python" , "nonunicode" , "default" ] | None = None ,
57
51
) -> None :
58
- variant_name : Literal ["python" , "nonunicode" , "default" ] | None = (
52
+ variant_name : t . Literal ["python" , "nonunicode" , "default" ] | None = (
59
53
variant_opt or legacy_opt
60
54
)
61
55
if variant_name :
You can’t perform that action at this time.
0 commit comments