##// END OF EJS Templates
restore sys.modules["__main__"] in the debugger...
mbyt -
Show More
@@ -227,10 +227,14 b' class Pdb(OldPdb, object):'
227 self.shell = get_ipython()
227 self.shell = get_ipython()
228
228
229 if self.shell is None:
229 if self.shell is None:
230 save_main = sys.modules['__main__']
230 # No IPython instance running, we must create one
231 # No IPython instance running, we must create one
231 from IPython.terminal.interactiveshell import \
232 from IPython.terminal.interactiveshell import \
232 TerminalInteractiveShell
233 TerminalInteractiveShell
233 self.shell = TerminalInteractiveShell.instance()
234 self.shell = TerminalInteractiveShell.instance()
235 # needed by any code which calls __import__("__main__") after
236 # the debugger was entered. See also #9941.
237 sys.modules['__main__'] = save_main
234
238
235 if color_scheme is not None:
239 if color_scheme is not None:
236 warnings.warn(
240 warnings.warn(
General Comments 0
You need to be logged in to leave comments. Login now