Skip to content

Commit f4108e5

Browse files
committed
Clean up import for pyright
1 parent d2d2be9 commit f4108e5

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

dash/development/_py_components_generation.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,16 @@
2222
import_string = """# AUTO GENERATED FILE - DO NOT EDIT
2323
2424
import typing # noqa: F401
25-
from typing import TYPE_CHECKING # noqa: F401
2625
from typing_extensions import TypedDict, NotRequired, Literal # noqa: F401
2726
from dash.development.base_component import Component, _explicitize_args
28-
if TYPE_CHECKING:
27+
try:
2928
from dash.types import NumberType # noqa: F401
30-
else:
31-
try:
32-
from dash.types import NumberType # noqa: F401
33-
except ImportError:
34-
NumberType = typing.Union[ # noqa: F401
35-
typing.SupportsFloat, typing.SupportsInt, typing.SupportsComplex
36-
]
29+
except ImportError:
30+
if typing.TYPE_CHECKING:
31+
raise
32+
NumberType = typing.Union[ # noqa: F401
33+
typing.SupportsFloat, typing.SupportsInt, typing.SupportsComplex
34+
]
3735
{custom_imports}
3836
ComponentSingleType = typing.Union[str, int, float, Component, None]
3937
ComponentType = typing.Union[

0 commit comments

Comments
 (0)