Skip to content

Commit 10f3017

Browse files
committed
use typing.TYPE_CHECKING to prevent import
1 parent eef46e8 commit 10f3017

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

IPython/core/inputtransformer2.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@
1414
from codeop import CommandCompiler, Compile
1515
import re
1616
import tokenize
17-
from typing import List, Tuple, Optional, Any
17+
from typing import List, Tuple, Optional, Any, TYPE_CHECKING
1818
import warnings
1919
import io
2020

21-
# only for type checking, do not import this, it lead to a circular
22-
# import
23-
if False:
21+
if TYPE_CHECKING:
2422
from IPython.core.interactiveshell import InteractiveShell
2523

2624
_indent_re = re.compile(r'^[ \t]+')

0 commit comments

Comments
 (0)