From 35626d251471c4b44526645576e83554526e06d7 2013-05-07 01:02:31 From: MinRK Date: 2013-05-07 01:02:31 Subject: [PATCH] don't use deprecated ipapi.get It's been deprecated for three releases. Come on guys. --- diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index fbcd74a..a4f908b 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -33,7 +33,6 @@ import sys from IPython import get_ipython from IPython.utils import PyColorize, ulinecache -from IPython.core import ipapi from IPython.utils import coloransi, io, py3compat from IPython.core.excolors import exception_colors @@ -205,7 +204,7 @@ class Pdb(OldPdb): # IPython changes... self.is_pydb = has_pydb - self.shell = ipapi.get() + self.shell = get_ipython() if self.is_pydb: diff --git a/IPython/core/page.py b/IPython/core/page.py index ca5332a..9c082c8 100644 --- a/IPython/core/page.py +++ b/IPython/core/page.py @@ -34,7 +34,7 @@ import tempfile from io import UnsupportedOperation -from IPython.core import ipapi +from IPython import get_ipython from IPython.core.error import TryNext from IPython.utils.data import chop from IPython.utils import io @@ -158,7 +158,7 @@ def page(strng, start=0, screen_lines=0, pager_cmd=None): start = max(0, start) # first, try the hook - ip = ipapi.get() + ip = get_ipython() if ip: try: ip.hooks.show_in_pager(strng) diff --git a/IPython/core/tests/refbug.py b/IPython/core/tests/refbug.py index 3ea69ec..5f60abe 100644 --- a/IPython/core/tests/refbug.py +++ b/IPython/core/tests/refbug.py @@ -18,7 +18,7 @@ test_run.py calls it. #----------------------------------------------------------------------------- import sys -from IPython.core import ipapi +from IPython import get_ipython #----------------------------------------------------------------------------- # Globals @@ -29,7 +29,7 @@ from IPython.core import ipapi # want to prevent. if __name__ == '__main__': - ip = ipapi.get() + ip = get_ipython() if not '_refbug_cache' in ip.user_ns: ip.user_ns['_refbug_cache'] = [] diff --git a/IPython/core/ultratb.py b/IPython/core/ultratb.py index a0d787b..4261339 100644 --- a/IPython/core/ultratb.py +++ b/IPython/core/ultratb.py @@ -99,7 +99,8 @@ from inspect import getsourcefile, getfile, getmodule,\ # IPython's own modules # Modified pdb which doesn't damage IPython's readline handling -from IPython.core import debugger, ipapi +from IPython import get_ipython +from IPython.core import debugger from IPython.core.display_trap import DisplayTrap from IPython.core.excolors import exception_colors from IPython.utils import PyColorize @@ -279,7 +280,7 @@ def _format_traceback_lines(lnum, index, lines, Colors, lvals=None,scheme=None): # This lets us get fully syntax-highlighted tracebacks. if scheme is None: - ipinst = ipapi.get() + ipinst = get_ipython() if ipinst is not None: scheme = ipinst.colors else: @@ -602,7 +603,7 @@ class ListTB(TBTools): # sync with user hooks if have_filedata: - ipinst = ipapi.get() + ipinst = get_ipython() if ipinst is not None: ipinst.hooks.synchronize_with_editor(value.filename, value.lineno, 0) @@ -957,7 +958,7 @@ class VerboseTB(TBTools): filepath, lnum = records[-1][1:3] #print "file:", str(file), "linenb", str(lnum) # dbg filepath = os.path.abspath(filepath) - ipinst = ipapi.get() + ipinst = get_ipython() if ipinst is not None: ipinst.hooks.synchronize_with_editor(filepath, lnum, 0) # vds: <<