Skip to content

Commit a606591

Browse files
authored
Fall back to builtin Enum for static type checking (#163)
Signed-off-by: Dennis Xu <[email protected]>
1 parent ae957bd commit a606591

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ccflow/enums.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import inspect
1818
from os import environ
19-
from typing import Any, Callable, Dict, List, Union
19+
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Union
2020

2121
from pydantic import GetJsonSchemaHandler
2222
from pydantic.json_schema import JsonSchemaValue
@@ -34,7 +34,7 @@
3434

3535
_CSP_ENUM = False
3636

37-
if environ.get("CCFLOW_NO_CSP", "0") != "1":
37+
if not TYPE_CHECKING and environ.get("CCFLOW_NO_CSP", "0") != "1":
3838
try:
3939
from csp import DynamicEnum, Enum as BaseEnum
4040

0 commit comments

Comments
 (0)