Updates IPython session with a custom one
(session)
| 443 | ############################## |
| 444 | |
| 445 | def update_ipython_session(session): |
| 446 | # type: (Dict[str, Any]) -> None |
| 447 | """Updates IPython session with a custom one""" |
| 448 | if "_oh" not in session: |
| 449 | session["_oh"] = session["Out"] = {} |
| 450 | session["In"] = {} |
| 451 | try: |
| 452 | from IPython import get_ipython |
| 453 | get_ipython().user_ns.update(session) |
| 454 | except Exception: |
| 455 | pass |
| 456 | |
| 457 | |
| 458 | def _scapy_prestart_builtins(): |