Copied from `IPython/terminal/embed.py`, but using our `InteractiveShellEmbed` instead.
(**kwargs)
| 306 | |
| 307 | |
| 308 | def embed(**kwargs): |
| 309 | """ |
| 310 | Copied from `IPython/terminal/embed.py`, but using our `InteractiveShellEmbed` instead. |
| 311 | """ |
| 312 | config = kwargs.get("config") |
| 313 | header = kwargs.pop("header", "") |
| 314 | compile_flags = kwargs.pop("compile_flags", None) |
| 315 | if config is None: |
| 316 | config = load_default_config() |
| 317 | config.InteractiveShellEmbed = config.TerminalInteractiveShell |
| 318 | kwargs["config"] = config |
| 319 | shell = InteractiveShellEmbed.instance(**kwargs) |
| 320 | initialize_extensions(shell, config["InteractiveShellApp"]["extensions"]) |
| 321 | run_exec_lines(shell, config["InteractiveShellApp"]["exec_lines"]) |
| 322 | run_startup_scripts(shell) |
| 323 | shell(header=header, stack_depth=2, compile_flags=compile_flags) |
| 324 | |
| 325 | |
| 326 | def run_startup_scripts(shell): |
no test coverage detected