Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipdb: pdef, pdoc, pinfo magics all broken #2169

Merged
merged 3 commits into from Jul 23, 2012
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions IPython/core/debugger.py
Expand Up @@ -478,19 +478,20 @@ def do_pdef(self, arg):
"""The debugger interface to magic_pdef"""
namespaces = [('Locals', self.curframe.f_locals),
('Globals', self.curframe.f_globals)]
self.shell.magic_pdef(arg, namespaces=namespaces)
self.shell.find_line_magic('pdef')(arg, namespaces=namespaces)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we cannot use self.shell.run_line_magic since we need to pass the namespaces parameter along.


def do_pdoc(self, arg):
"""The debugger interface to magic_pdoc"""
namespaces = [('Locals', self.curframe.f_locals),
('Globals', self.curframe.f_globals)]
self.shell.magic_pdoc(arg, namespaces=namespaces)
self.shell.find_line_magic('pdoc')(arg, namespaces=namespaces)

def do_pinfo(self, arg):
"""The debugger equivalant of ?obj"""
namespaces = [('Locals', self.curframe.f_locals),
('Globals', self.curframe.f_globals)]
self.shell.magic_pinfo("pinfo %s" % arg, namespaces=namespaces)
self.shell.find_line_magic('pinfo')("pinfo %s" % arg,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you decide to make the call this way and not with the higher-level run_line_magic method?

namespaces=namespaces)

def checkline(self, filename, lineno):
"""Check whether specified line seems to be executable.
Expand Down
2 changes: 1 addition & 1 deletion IPython/core/interactiveshell.py
Expand Up @@ -1479,7 +1479,7 @@ def _inspect(self, meth, oname, namespaces=None, **kw):
"""Generic interface to the inspector system.

This function is meant to be called by pdef, pdoc & friends."""
info = self._object_find(oname)
info = self._object_find(oname, namespaces)
if info.found:
pmethod = getattr(self.inspector, meth)
formatter = format_screen if info.ismagic else None
Expand Down