[Python-modules-commits] [ipdb] 02/11: ipython5 use TerminalInteractiveShell debugger_cls
Andrey Rahmatullin
wrar at moszumanska.debian.org
Thu Jan 18 17:50:19 UTC 2018
This is an automated email from the git hooks/post-receive script.
wrar pushed a commit to annotated tag 0.10.2
in repository ipdb.
commit 1a12c549bf3f2ef63b67cb5af3d52254240a1d6a
Author: Joseph Kahn <josephbkahn at gmail.com>
Date: Sat Aug 6 11:42:27 2016 -0400
ipython5 use TerminalInteractiveShell debugger_cls
---
ipdb/__main__.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/ipdb/__main__.py b/ipdb/__main__.py
index b003a87..030bab2 100644
--- a/ipdb/__main__.py
+++ b/ipdb/__main__.py
@@ -25,10 +25,12 @@ def import_module(possible_modules, needed_module):
raise
try:
# IPython 5.0 and newer
- from IPython.terminal.debugger import TerminalPdb as Pdb
from IPython.core.debugger import BdbQuit_excepthook
+ from IPython.terminal.interactiveshell import TerminalInteractiveShell
+ debugger_cls = TerminalInteractiveShell().debugger_cls
except ImportError:
from IPython.core.debugger import Pdb, BdbQuit_excepthook
+ debugger_cls = Pdb
possible_modules = ['IPython.terminal.ipapp', # Newer IPython
'IPython.frontend.terminal.ipapp'] # Older IPython
@@ -70,10 +72,10 @@ def_exec_lines = [line + '\n' for line in ipapp.exec_lines]
def _init_pdb(context=3):
- if 'context' in getargspec(Pdb.__init__)[0]:
- p = Pdb(def_colors, context=context)
+ if 'context' in getargspec(debugger_cls.__init__)[0]:
+ p = debugger_cls(def_colors, context=context)
else:
- p = Pdb(def_colors)
+ p = debugger_cls(def_colors)
p.rcLines += def_exec_lines
return p
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/ipdb.git
More information about the Python-modules-commits
mailing list