Show More
@@ -49,6 +49,7 b' from .core.error import TryNext' | |||
|
49 | 49 | from .core.interactiveshell import InteractiveShell |
|
50 | 50 | from .testing import test |
|
51 | 51 | from .utils.sysinfo import sys_info |
|
52 | from .utils.frame import caller_module_and_locals | |
|
52 | 53 | |
|
53 | 54 | # Release data |
|
54 | 55 | __author__ = '' |
@@ -57,13 +58,6 b' for author, email in release.authors.itervalues():' | |||
|
57 | 58 | __license__ = release.license |
|
58 | 59 | __version__ = release.version |
|
59 | 60 | |
|
60 | def caller_module_and_locals(): | |
|
61 | """Returns (module, locals) of the caller""" | |
|
62 | caller = sys._getframe(2) | |
|
63 | global_ns = caller.f_globals | |
|
64 | module = sys.modules[global_ns['__name__']] | |
|
65 | return (module, caller.f_locals) | |
|
66 | ||
|
67 | 61 | def embed_kernel(module=None, local_ns=None): |
|
68 | 62 | """Call this to embed an IPython kernel at the current point in your program. """ |
|
69 | 63 | (caller_module, caller_locals) = caller_module_and_locals() |
@@ -85,3 +85,10 b" def debugx(expr,pre_msg=''):" | |||
|
85 | 85 | # deactivate it by uncommenting the following line, which makes it a no-op |
|
86 | 86 | #def debugx(expr,pre_msg=''): pass |
|
87 | 87 | |
|
88 | def caller_module_and_locals(): | |
|
89 | """Returns (module, locals) of the caller""" | |
|
90 | caller = sys._getframe(2) | |
|
91 | global_ns = caller.f_globals | |
|
92 | module = sys.modules[global_ns['__name__']] | |
|
93 | return (module, caller.f_locals) | |
|
94 |
General Comments 0
You need to be logged in to leave comments.
Login now