[Python-modules-commits] [ipdb] 05/11: Make context arg work for newer versions of IPython

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 da9892cdac4f7d62420321d2f43ebf9116552cde
Author: Georg Nebehay <gnebehay at gmail.com>
Date:   Fri Jan 20 15:39:57 2017 +0100

    Make context arg work for newer versions of IPython
---
 ipdb/__main__.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ipdb/__main__.py b/ipdb/__main__.py
index b003a87..1b2a833 100644
--- a/ipdb/__main__.py
+++ b/ipdb/__main__.py
@@ -70,9 +70,9 @@ def_exec_lines = [line + '\n' for line in ipapp.exec_lines]
 
 
 def _init_pdb(context=3):
-    if 'context' in getargspec(Pdb.__init__)[0]:
+    try:
         p = Pdb(def_colors, context=context)
-    else:
+    except TypeError:
         p = Pdb(def_colors)
     p.rcLines += def_exec_lines
     return p
@@ -90,6 +90,7 @@ def set_trace(frame=None, context=3):
     wrap_sys_excepthook()
     if frame is None:
         frame = sys._getframe().f_back
+
     p = _init_pdb(context).set_trace(frame)
     if p and hasattr(p, 'shell'):
         p.shell.restore_sys_module_state()

-- 
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