diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-12-15 16:58:19 -0500 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-12-15 16:58:19 -0500 |
commit | 42080d5c3e57feae5374516fecf7987dc4fc7cfa (patch) | |
tree | 43907227a2bf12581c9f142ff9e5891c2677a461 | |
parent | f5af7d32fb468012f793eb039e05a86292e0e5bf (diff) | |
download | cmd2-git-42080d5c3e57feae5374516fecf7987dc4fc7cfa.tar.gz |
Simplified import
-rw-r--r-- | cmd2/command_definition.py | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/cmd2/command_definition.py b/cmd2/command_definition.py index ccf3a6d4..da1c9152 100644 --- a/cmd2/command_definition.py +++ b/cmd2/command_definition.py @@ -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, @@ -21,18 +22,8 @@ from .utils import ( 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 |