Annotate get_ipython by jenshnielsen · Pull Request #15232 · ipython/ipython · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion IPython/core/compilerop.py
7 changes: 4 additions & 3 deletions IPython/core/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,17 +299,18 @@ def __init__(
self.curframe = None

# IPython changes...
self.shell = get_ipython()
shell = get_ipython()

if self.shell is None:
if shell is None:
save_main = sys.modules["__main__"]
# No IPython instance running, we must create one
from IPython.terminal.interactiveshell import TerminalInteractiveShell

self.shell = TerminalInteractiveShell.instance()
shell = TerminalInteractiveShell.instance()
# needed by any code which calls __import__("__main__") after
# the debugger was entered. See also #9941.
sys.modules["__main__"] = save_main
self.shell = shell

self.aliases = {}

Expand Down
18 changes: 11 additions & 7 deletions IPython/core/getipython.py
Loading