File tree Expand file tree Collapse file tree 1 file changed +39
-1
lines changed Expand file tree Collapse file tree 1 file changed +39
-1
lines changed Original file line number Diff line number Diff line change 1313logger = logging .getLogger (__name__ )
1414
1515
16- def launch (shell = None , best = True , use_pythonrc = False , ** kwargs ):
16+ def has_ipython ():
17+ try :
18+ from IPython import start_ipython # NOQA F841
19+ except ImportError :
20+ try :
21+ from IPython .Shell import IPShell # NOQA F841
22+ except ImportError :
23+ return False
24+
25+ return True
26+
27+
28+ def has_ptpython ():
29+ try :
30+ from ptpython .repl import embed , run_config # NOQA F841
31+ except ImportError :
32+ try :
33+ from prompt_toolkit .contrib .repl import embed , run_config # NOQA F841
34+ except ImportError :
35+ return False
36+
37+ return True
38+
39+
40+ def has_ptipython ():
41+ try :
42+ from ptpython .ipython import embed # NOQA F841
43+ from ptpython .repl import run_config # NOQA F841
44+ except ImportError :
45+ try :
46+ from prompt_toolkit .contrib .ipython import embed # NOQA F841
47+ from prompt_toolkit .contrib .repl import run_config # NOQA F841
48+ except ImportError :
49+ return False
50+
51+ return True
52+
53+
54+ def launch (shell = 'best' , use_pythonrc = False , ** kwargs ):
1755 import code
1856
1957 import libtmux
You can’t perform that action at this time.
0 commit comments