From 42080d5c3e57feae5374516fecf7987dc4fc7cfa Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Wed, 15 Dec 2021 16:58:19 -0500 Subject: Simplified import --- cmd2/command_definition.py | 15 +++------------ 1 file 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 -- cgit v1.2.1