Show More
@@ -887,6 +887,13 def embed_kernel(module=None, local_ns=None, **kwargs): | |||
|
887 | 887 | else: |
|
888 | 888 | app = IPKernelApp.instance(**kwargs) |
|
889 | 889 | app.initialize([]) |
|
890 | # Undo unnecessary sys module mangling from init_sys_modules. | |
|
891 | # This would not be necessary if we could prevent it | |
|
892 | # in the first place by using a different InteractiveShell | |
|
893 | # subclass, as in the regular embed case. | |
|
894 | main = app.kernel.shell._orig_sys_modules_main_mod | |
|
895 | if main is not None: | |
|
896 | sys.modules[app.kernel.shell._orig_sys_modules_main_name] = main | |
|
890 | 897 | |
|
891 | 898 | # load the calling scope if not given |
|
892 | 899 | (caller_module, caller_locals) = extract_module_locals(1) |
General Comments 0
You need to be logged in to leave comments.
Login now