Skip to content

Commit 42080d5

Browse files
committed
Simplified import
1 parent f5af7d3 commit 42080d5

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

cmd2/command_definition.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Supports the definition of commands in separate classes to be composed into cmd2.Cmd
44
"""
55
from typing import (
6+
TYPE_CHECKING,
67
Callable,
78
Dict,
89
Mapping,
@@ -21,18 +22,8 @@
2122
Settable,
2223
)
2324

24-
# Allows IDEs to resolve types without impacting imports at runtime, breaking circular dependency issues
25-
try: # pragma: no cover
26-
from typing import (
27-
TYPE_CHECKING,
28-
)
29-
30-
if TYPE_CHECKING:
31-
import cmd2
32-
33-
except ImportError: # pragma: no cover
34-
pass
35-
25+
if TYPE_CHECKING:
26+
import cmd2
3627

3728
#: Callable signature for a basic command function
3829
#: Further refinements are needed to define the input parameters

0 commit comments

Comments
 (0)