[Python-modules-commits] [ipdb] 06/11: Merge branch 'master' of https://github.com/JBKahn/ipdb into JBKahn-master
Andrey Rahmatullin
wrar at moszumanska.debian.org
Thu Jan 18 17:50:20 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 a6dda1b0b2eb124965e4f18b756929f516bf9731
Merge: da9892c 9cd32f2
Author: Georg Nebehay <gnebehay at gmail.com>
Date: Fri Jan 20 17:06:11 2017 +0100
Merge branch 'master' of https://github.com/JBKahn/ipdb into JBKahn-master
ipdb/__main__.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --cc ipdb/__main__.py
index 1b2a833,31b0409..75bddde
--- a/ipdb/__main__.py
+++ b/ipdb/__main__.py
@@@ -27,8 -31,8 +27,13 @@@ 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
++ # Let IPython decide about which debugger class to use
++ # This is especially important for tools that fiddle with stdout
++ 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
@@@ -68,12 -72,19 +73,11 @@@ else
def_exec_lines = [line + '\n' for line in ipapp.exec_lines]
-
-def _get_debugger_cls():
- if ipython_version < (5, 0, 0):
- return Pdb
- return TerminalInteractiveShell().debugger_cls
-
--
def _init_pdb(context=3):
- debugger_cls = _get_debugger_cls()
- if 'context' in getargspec(debugger_cls.__init__)[0]:
+ try:
- p = Pdb(def_colors, context=context)
+ p = debugger_cls(def_colors, context=context)
- else:
+ except TypeError:
- 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