Skip to content

Commit

Permalink
Simplified import
Browse files Browse the repository at this point in the history
  • Loading branch information
kmvanbrunt committed Dec 15, 2021
1 parent f5af7d3 commit 42080d5
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions cmd2/command_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Supports the definition of commands in separate classes to be composed into cmd2.Cmd
"""
from typing import (
TYPE_CHECKING,
Callable,
Dict,
Mapping,
Expand All @@ -21,18 +22,8 @@
Settable,
)

# Allows IDEs to resolve types without impacting imports at runtime, breaking circular dependency issues
try: # pragma: no cover
from typing import (
TYPE_CHECKING,
)

if TYPE_CHECKING:
import cmd2

except ImportError: # pragma: no cover
pass

if TYPE_CHECKING:
import cmd2

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

0 comments on commit 42080d5

Please sign in to comment.