##// END OF EJS Templates
undo initial clobbering done by init_sys_modules in embed_kernel...
MinRK -
Show More
@@ -887,6 +887,13 b' def embed_kernel(module=None, local_ns=None, **kwargs):'
887 else:
887 else:
888 app = IPKernelApp.instance(**kwargs)
888 app = IPKernelApp.instance(**kwargs)
889 app.initialize([])
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 # load the calling scope if not given
898 # load the calling scope if not given
892 (caller_module, caller_locals) = extract_module_locals(1)
899 (caller_module, caller_locals) = extract_module_locals(1)
General Comments 0
You need to be logged in to leave comments. Login now