diff --git a/IPython/__init__.py b/IPython/__init__.py index df54346..d2c3345 100644 --- a/IPython/__init__.py +++ b/IPython/__init__.py @@ -49,7 +49,7 @@ from .core.error import TryNext from .core.interactiveshell import InteractiveShell from .testing import test from .utils.sysinfo import sys_info -from .utils.frame import extract_module_locals_above +from .utils.frame import extract_module_locals # Release data __author__ = '' @@ -60,7 +60,7 @@ __version__ = release.version def embed_kernel(module=None, local_ns=None): """Call this to embed an IPython kernel at the current point in your program. """ - (caller_module, caller_locals) = extract_module_locals_above() + (caller_module, caller_locals) = extract_module_locals(1) if module is None: module = caller_module if local_ns is None: diff --git a/IPython/utils/frame.py b/IPython/utils/frame.py index cd3563a..13f484d 100644 --- a/IPython/utils/frame.py +++ b/IPython/utils/frame.py @@ -92,9 +92,3 @@ def extract_module_locals(depth=0): module = sys.modules[global_ns['__name__']] return (module, f.f_locals) -def extract_module_locals_above(): - """Returns (module, locals) of the funciton calling the caller. - Like extract_module_locals() with a specified depth of 1.""" - # we're one frame away from the target, the function we call would be two frames away - return extract_module_locals(1 + 1) -