mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-20 15:16:19 +01:00
Avoid ipython repeated exception when not available
This commit is contained in:
parent
a37c14499c
commit
03b7feb507
1 changed files with 3 additions and 0 deletions
|
|
@ -187,11 +187,14 @@ def simple_repl(user_ns={}):
|
|||
|
||||
def ipython(user_ns=None):
|
||||
os.environ['IPYTHONDIR'] = ipydir
|
||||
have_ipython = True
|
||||
try:
|
||||
from IPython.terminal.embed import InteractiveShellEmbed
|
||||
from traitlets.config.loader import Config
|
||||
from IPython.terminal.prompts import Prompts, Token
|
||||
except ImportError:
|
||||
have_ipython = False
|
||||
if not have_ipython:
|
||||
return simple_repl(user_ns=user_ns)
|
||||
|
||||
class CustomPrompt(Prompts):
|
||||
|
|
|
|||
Loading…
Reference in a new issue