From 482ccc3a8356a3a7933c39072a94948be0e6072f 2013-07-02 16:56:45 From: Min RK Date: 2013-07-02 16:56:45 Subject: [PATCH] Merge pull request #3511 from punchagan/fix-tracer Get Tracer working when no IPython instance is running --- diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index a4f908b..6b214a3 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -206,6 +206,12 @@ class Pdb(OldPdb): self.shell = get_ipython() + if self.shell is None: + # No IPython instance running, we must create one + from IPython.terminal.interactiveshell import \ + TerminalInteractiveShell + self.shell = TerminalInteractiveShell.instance() + if self.is_pydb: # interactiveshell.py's ipalias seems to want pdb's checkline